1
2
3
4
5 package com.jcabi.github.mock;
6
7 import com.jcabi.github.Comments;
8 import java.io.IOException;
9 import java.util.Date;
10 import org.hamcrest.MatcherAssert;
11 import org.hamcrest.Matchers;
12 import org.junit.jupiter.api.Test;
13
14
15
16
17
18 final class MkCommentsTest {
19
20
21
22
23
24 @Test
25 void iteratesComments() throws Exception {
26 final Comments comments = MkCommentsTest.comments();
27 comments.post("hello, dude!");
28 comments.post("hello again");
29 MatcherAssert.assertThat(
30 "Collection size is incorrect",
31 comments.iterate(new Date(0L)),
32 Matchers.iterableWithSize(2)
33 );
34 }
35
36
37
38
39
40 private static Comments comments() throws IOException {
41 return new MkGitHub().randomRepo()
42 .issues().create("hey", "how are you?")
43 .comments();
44 }
45 }