Package org.hamcrest

Examples of org.hamcrest.Matcher.matches()


  }

  @Test
  public void doesNotMatchText() throws Exception {
    Matcher matcher = withText("Some Text");
    assertFalse(matcher.matches(new Object()));
  }

  @Test
  public void matchText() throws Exception {
    Matcher matcher = withText("Some Text");
View Full Code Here


  }

  @Test
  public void matchText() throws Exception {
    Matcher matcher = withText("Some Text");
    assertTrue(matcher.matches(new ObjectWithGetText("Some Text")));
  }

  @Test
  public void matchTextIgnoreCase() throws Exception {
    Matcher matcher = withTextIgnoringCase("Some Text");
View Full Code Here

  }

  @Test
  public void matchTextIgnoreCase() throws Exception {
    Matcher matcher = withTextIgnoringCase("Some Text");
    assertTrue(matcher.matches(new ObjectWithGetText("some text")));
  }

  @Test
  public void getsToString() throws Exception {
    Matcher matcher = withText("Some Text");
View Full Code Here

public class MenuMnemonicTextMatcherTest {

  @Test
  public void matchesMenuWithMnemonic() throws Exception {
    Matcher matcher = withMnemonic("New Mnemonic");
    assertTrue(matcher.matches(new ObjectWithGetText("New &Mnemonic\tCTRL_M")));
  }

  @Test
  public void matchesMenuWithoutMnemonic() throws Exception {
    Matcher matcher = withMnemonic("New Mnemonic");
View Full Code Here

  }

  @Test
  public void matchesMenuWithoutMnemonic() throws Exception {
    Matcher matcher = withMnemonic("New Mnemonic");
    assertTrue(matcher.matches(new ObjectWithGetText("New Mnemonic\tCTRL_M")));
  }

  @Test
  public void matchesMenuWithoutAccesor() throws Exception {
    Matcher matcher = withMnemonic("New Mnemonic");
View Full Code Here

  }

  @Test
  public void matchesMenuWithoutAccesor() throws Exception {
    Matcher matcher = withMnemonic("New Mnemonic");
    assertTrue(matcher.matches(new ObjectWithGetText("New Mnemonic")));
  }

  @Test
  public void matchesMnemonic() throws Exception {
    Object object = new ObjectWithGetText("&New Mnemonic");
View Full Code Here

public class MessageMatcherTest {

  @Test
  public void doesNotMatchObjectsWithNoGetMessageMethod() throws Exception {
    Matcher matcher = withMessage("Some Text");
    assertFalse(matcher.matches(new Object()));
  }

  @Test
  public void doesNotMatchObjectsWithNullGetMessage() throws Exception {
    Matcher matcher = withMessage("Some Text");
View Full Code Here

  }

  @Test
  public void doesNotMatchObjectsWithNullGetMessage() throws Exception {
    Matcher matcher = withMessage("Some Text");
    assertFalse(matcher.matches(new ObjectWithGetMessage(null)));
  }

  @Test
  public void doesNotMatchMessage() throws Exception {
    Matcher matcher = withMessage("Some Text");
View Full Code Here

  }

  @Test
  public void doesNotMatchMessage() throws Exception {
    Matcher matcher = withMessage("Some Text");
    assertFalse(matcher.matches(new ObjectWithGetMessage("Some Other Text")));
  }

  @Test
  public void matchMessage() throws Exception {
    Matcher matcher = withMessage("Some Text");
View Full Code Here

  }

  @Test
  public void matchMessage() throws Exception {
    Matcher matcher = withMessage("Some Text");
    assertTrue(matcher.matches(new ObjectWithGetMessage("Some Text")));
  }


  @Test
  public void getsToString() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.