Package org.fest.assertions.description

Examples of org.fest.assertions.description.Description


    objects.assertNotEqual(mock(Description.class), "Yoda", "Luke");
  }

  @Test
  public void should_fail_if_objects_are_equal() {
    Description description = new TestDescription("Testing");
    try {
      objects.assertNotEqual(description, "Yoda", "Yoda");
    } catch (AssertionError e) {
      verify(failures).failure(description, shouldNotBeEqual("Yoda", "Yoda"));
      return;
View Full Code Here


    objects.assertIsNotInstanceOf(mock(Description.class), actual, null);
  }

  @Test
  public void should_fail_if_actual_is_instance_of_type() {
    Description description = new TestDescription("Testing");
    try {
      objects.assertIsNotInstanceOf(description, actual, Person.class);
    } catch (AssertionError e) {
      String message = "[Testing] expecting <Person[name='Yoda']> not to be an instance of:"
          + "<org.fest.assertions.test.Person>";
View Full Code Here

    files.assertDoesNotExist(mock(Description.class), actual);
  }

  @Test
  public void should_fail_if_actual_exists() {
    Description description = new TestDescription("Testing");
    File actual = newWritableFile("/usr/local/actual.txt");
    try {
      files.assertDoesNotExist(description, actual);
    } catch (AssertionError e) {
      assertEquals("[Testing] expecting resource in path:</usr/local/actual.txt> not to exist", e.getMessage());
View Full Code Here

    objects.assertNotNull(mock(Description.class), "Yoda");
  }

  @Test
  public void should_fail_if_object_is_null() {
    Description description = new TestDescription("Testing");
    try {
      objects.assertNotNull(description, null);
    } catch (AssertionError e) {
      assertEquals("[Testing] expecting: actual value not to be null", e.getMessage());
      verify(failures).failure(same(description), any(ErrorMessageFactory.class));
View Full Code Here

    verify(a).compareTo(o);
  }

  @Test
  public void should_fail_if_objects_are_equal() {
    Description description = new TestDescription("Testing");
    Person a = spy(new Person("Yoda"));
    Person o = new Person("Yoda");
    try {
      comparables.assertNotEqual(description, a, o);
    } catch (AssertionError e) {
View Full Code Here

  }

  @Test
  public void should_fail_if_Matcher_is_met() {
    matcher.shouldMatch(true);
    Description description = new TestDescription("Testing");
    try {
      matchers.assertDoesNotHave(description, "Yoda", matcher);
    } catch (AssertionError e) {
      assertEquals("[Testing] expecting:<'Yoda'> not to have:<TestMatcher>", e.getMessage());
      verify(failures).failure(same(description), any(ErrorMessageFactory.class));
View Full Code Here

    comparables.failures = failures;
  }

  @Test
  public void should_fail_if_actual_is_not_less_than_other() {
    Description description = new TestDescription("Testing");
    try {
      comparables.assertLessThan(description, actual, other);
    } catch (AssertionError e) {
      String message = "[Testing] expecting:\n<" + quote(actual) + "> should be less than:<" + quote(other) + ">";
      assertEquals(message, e.getMessage());
View Full Code Here

    thrown.expect(AssertionError.class, actualIsNull());
    strings.assertDoesNotContain(mock(Description.class), null, "Yoda");
  }

  @Test public void should_fail_if_actual_contains_sequence() {
    Description description = new TestDescription("Testing");
    try {
      strings.assertDoesNotContain(description, "Yoda", "oda");
    } catch (AssertionError e) {
      assertEquals("[Testing] expecting:<'Yoda'> not to contain:<'oda'>", e.getMessage());
      verify(failures).failure(same(description), any(ErrorMessageFactory.class));
View Full Code Here

    objects.assertIsNotInstanceOfAny(mock(Description.class), actual, types);
  }

  @Test
  public void should_fail_if_actual_is_instance_of_any_type() {
    Description description = new TestDescription("Testing");
    Class<?>[] types = { File.class, Person.class };
    try {
      objects.assertIsNotInstanceOfAny(description, actual, types);
    } catch (AssertionError e) {
      String message = "[Testing] expecting <Person[name='Yoda']> not to be an instance of any of:"
View Full Code Here

    strings.assertNotEmpty(mock(Description.class), null);
  }

  @Test
  public void should_fail_if_actual_is_empty() {
    Description description = new TestDescription("Testing");
    try {
      strings.assertNotEmpty(description, "");
    } catch (AssertionError e) {
      assertEquals("[Testing] expecting:\n actual not to be empty", e.getMessage());
      return;
View Full Code Here

TOP

Related Classes of org.fest.assertions.description.Description

Copyright © 2018 www.massapicom. 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.