Skip to content

Instantly share code, notes, and snippets.

@chaudum
Last active August 29, 2015 14:05
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 chaudum/96b8b5b58444fc569ef8 to your computer and use it in GitHub Desktop.
Save chaudum/96b8b5b58444fc569ef8 to your computer and use it in GitHub Desktop.
JUnit4 Testcase
package io.crate
public class AwesomeCrateClass {
public Boolean myMethod(Boolean value) {
return !value;
}
}
import org.junit.Test;
import static org.junit.Assert.*;
public class AwesomeCrateClassTest {
final static AwesomeCrateClass myClass = new AwesomeCrateClass();
@Test
public void testMyMethod() throws Exception {
Boolean inputValue = true;
Boolean outputValue = myClass.myMethod(true);
assertTrue(inputValue == false);
assertEquals(inputValue, false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment