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
void inputOutputExample() { | |
Iterable<String> inputData = Arrays.asList("a", "b", ...); | |
String result = processor.process(input) | |
assertThat(result).isEqualTo("expected"); | |
} |
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
void dataAreStoredInMap() { | |
DataReader reader = new DummyReader("key1,value1", "key2,value2"); | |
processor.process(reader); | |
// ... | |
} |
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
@Test(expected = IllegalArgumentException.class) | |
void someTest() {...} |
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
void moreAssert() { | |
assertThat(price.getTax()).isEqualTo(456); | |
assertThat(price.getVipDiscount()).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
assertThat(timeInSeconds).isEqualTo(object.getValue() * 2 * MINUTES); | |
// vs. | |
assertThat(timeInSeconds).isEqualTo(2_500); |
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
@Test | |
public void shouldNavigateToPhotosPage() { | |
String baseUrl = "http://plus.google.com/"; | |
Navigator nav = new Navigator(baseUrl); | |
nav.goToPhotosPage(); | |
assertEquals(baseUrl + "/u/0/photos", nav.getCurrentUrl()); | |
} |
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
void variablesInInputStringAreReplacedByTheirValues() {...} | |
void exceptionIsThrownWhenVariableIsNotFound() {...} | |
void variableCanBeOverwritenInChildContext() {...} | |
void parametersCannotBeOverwritenInChildContext() {...} | |
void builderThrowExceptionWhenRegisteringVariableWithSameNameAsParameter() {...} | |
// ... etc |
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
void variablesInInputStringAreReplacedByTheirValues() {...} | |
void exceptionIsThrownWhenVariableIsNotFound() {...} | |
void variableCanBeOverwritenInChildContext() {...} | |
void parametersCannotBeOverwritenInChildContext() {...} | |
void builderThrowExceptionWhenRegisteringVariableWithSameNameAsParameter() {...} | |
// ... etc |
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
void testAdd() {...} | |
void testCalculation() {...} | |
void throwsException() {...} | |
void testRemove() {...} |
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
// don’t do this | |
DateTimeUtils.setCurrentMillisFixed(millis); | |
// or this | |
ReflectionUtils.setField(service, "fieldName", fieldValue); |
NewerOlder