Skip to content

Commit 0badedc

Browse files
committed
Make language in examples consistent with Simple Programming paradigm description + Simplify exception lambda in example code
1 parent c7c525c commit 0badedc

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ import static com.andyln.Mof.ALL;
118118
119119
@Test
120120
public void success() throws Exception {
121-
// Given (Setup Data)
121+
// Given (Setup data)
122122
Food expected = SAMPLE_HOT_FOOD;
123123
124-
// Given (Setup Data Processors)
124+
// Given (Setup processors)
125125
mof.when(ALL);
126126
127127
// When (Run the thing that you want to test)
@@ -130,7 +130,7 @@ import static com.andyln.Mof.ALL;
130130
// Then (Asserting what you want to be true, is actually true)
131131
assertEquals(expected, actual);
132132
133-
// Verify (Asserting the Data Processors are called in the way you want)
133+
// Verify (Asserting the processors are called in the way you want)
134134
mof.verify(ALL);
135135
}
136136
```
@@ -144,22 +144,20 @@ import static com.andyln.Mof.REMAINING;
144144
145145
@Test
146146
public void whenMotorFails_ThenThrowAnException() throws Exception {
147-
// Given (Setup Data)
147+
// Given (Setup data)
148148
// No data to setup
149149
150-
// Given (Setup Data Processors)
150+
// Given (Setup processors)
151151
mof.whenBefore(motor);
152152
when(motor.spinTurntable(any(Timer.class))).thenThrow(new RuntimeException(SAMPLE_EXCEPTION_MESSAGE));
153153
154154
// When (Run the thing that you want to test)
155-
Exception actualException = assertThrows(Exception.class, () -> {
156-
microwave.heatFood(SAMPLE_COLD_FOOD, SAMPLE_SECONDS)
157-
});
155+
Exception actualException = assertThrows(Exception.class, () -> microwave.heatFood(SAMPLE_COLD_FOOD, SAMPLE_SECONDS));
158156
159157
// Then (Asserting what you want to be true, is actually true)
160158
assertEquals(SAMPLE_EXCEPTION_MESSAGE, actualException.getMessage());
161159
162-
// Verify (Asserting the Data Processors are called in the way you want)
160+
// Verify (Asserting the processors are called in the way you want)
163161
mof.verifyThrough(motor);
164162
mof.verifyNoInteractions(REMAINING);
165163
}

0 commit comments

Comments
 (0)