Skip to content

Instantly share code, notes, and snippets.

@olafleur
Created May 10, 2016 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olafleur/09e09ad6662fb099983bfd24be0dd0fa to your computer and use it in GitHub Desktop.
Save olafleur/09e09ad6662fb099983bfd24be0dd0fa to your computer and use it in GitHub Desktop.
import static com.olivierlafleur.testtest.MyTestFramework.checkEqual;
import static com.olivierlafleur.testtest.MyTestFramework.checkTrue;
public class TestsClass {
//This test should fail because it raises an exception
public void divisionByZeroTest() {
int var1 = 1;
int var2 = 2;
int res = 2/0;
checkTrue(var2 > var1);
}
//This test should pass
public void anotherTest() {
int var1 = 1;
int var2 = 2;
checkTrue(var2 > var1);
}
//This test should fail
public void anotherTest2() {
int var1 = 1;
int var2 = 2;
checkTrue(var1 > var2);
}
//This test should pass
public void equalityTest() {
checkEqual(2, 2);
}
//This test should fail
public void inequalityTest() {
checkEqual(1, 2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment