Created
September 24, 2011 14:28
-
-
Save php-coder/1239381 to your computer and use it in GitHub Desktop.
Example of fest-asserts usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
assertThat(page.userBarExists()) | |
.overridingErrorMessage("user bar should exists") | |
.isTrue(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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