Skip to content

Instantly share code, notes, and snippets.

@php-coder
Created September 24, 2011 14:28
Show Gist options
  • Save php-coder/1239381 to your computer and use it in GitHub Desktop.
Save php-coder/1239381 to your computer and use it in GitHub Desktop.
Example of fest-asserts usage
import static org.fest.assertions.Assertions.assertThat;
@Test
public void booleanAssertions() {
assertThat(true).isTrue();
assertThat(false).isFalse();
}
@Test
public void objectsAssertions() {
assertThat(null).isNull();
assertThat(new Object()).isNotNull();
}
@Test
public void equalsAssertions() {
final String actualValue = "test";
final String expectedValue = "test";
assertThat(actualValue).isEqualTo(expectedValue);
}
assertThat(page.userBarExists())
.overridingErrorMessage("user bar should exists")
.isTrue();
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment