Skip to content

Commit 614de95

Browse files
committed
Add assertions to a couple of @koans that don't have them yet.
1 parent 5b4c07d commit 614de95

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

koans/src/advanced/AboutMocks.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.sandwich.koan.Koan;
44

5+
import static com.sandwich.util.Assert.assertTrue;
56
import static com.sandwich.util.Assert.fail;
67

78
public class AboutMocks {
@@ -40,7 +41,7 @@ public void simpleAnonymousMock() {
4041
// HINT: pass a safe Collaborator implementation to constructor
4142
// new ClassUnderTest(new Collaborator(){... it should not be the
4243
// objective of this test to test that collaborator, so replace it
43-
new ClassUnderTest().doSomething();
44+
assertTrue(new ClassUnderTest().doSomething());
4445
}
4546

4647
}

koans/src/beginner/AboutArrays.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public void arrayIndexOutOfBounds() {
6666
int[] array = new int[]{1};
6767
@SuppressWarnings("unused")
6868
int meh = array[1]; // remember 0 based indexes, 1 is the 2nd element (which doesn't exist)
69+
assertEquals(meh, __);
6970
}
7071

7172
@Koan

koans/src/beginner/AboutExceptions.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import static com.sandwich.koan.constant.KoanConstants.__;
88
import static com.sandwich.util.Assert.assertEquals;
9+
import static com.sandwich.util.Assert.assertTrue;
910

1011
public class AboutExceptions {
1112

@@ -103,6 +104,7 @@ private void doUncheckedStuff() {
103104
public void catchUncheckedExceptions() {
104105
// What do you need to do to catch the unchecked exception?
105106
doUncheckedStuff();
107+
assertTrue(true);
106108
}
107109

108110
@SuppressWarnings("serial")

0 commit comments

Comments
 (0)