-
-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathLaziness.java
More file actions
20 lines (15 loc) · 671 Bytes
/
Laziness.java
File metadata and controls
20 lines (15 loc) · 671 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package testsupport.traits;
import com.jnape.palatable.lambda.functions.Fn1;
import com.jnape.palatable.traitor.traits.Trait;
import static org.junit.Assert.assertThat;
import static testsupport.Mocking.mockIterable;
import static testsupport.matchers.ZeroInvocationsMatcher.wasNeverInteractedWith;
public class Laziness implements Trait<Fn1<Iterable<?>, Iterable<?>>> {
@Override
public void test(Fn1<Iterable<?>, Iterable<?>> testSubject) {
Iterable<?> iterable = mockIterable();
testSubject.apply(iterable);
assertThat(iterable, wasNeverInteractedWith());
assertThat(iterable.iterator(), wasNeverInteractedWith());
}
}