Merge branch 'next' into feature/album-and-image-links
[Sone.git] / src / test / java / net / pterodactylus / sone / core / CoreTest.java
1 package net.pterodactylus.sone.core;
2
3 import static org.mockito.Matchers.eq;
4 import static org.mockito.Mockito.mock;
5 import static org.mockito.Mockito.verify;
6
7 import net.pterodactylus.sone.core.Core.MarkPostKnown;
8 import net.pterodactylus.sone.core.Core.MarkReplyKnown;
9 import net.pterodactylus.sone.data.Post;
10 import net.pterodactylus.sone.data.PostReply;
11
12 import org.junit.Test;
13
14 /**
15  * Unit test for {@link Core} and its subclasses.
16  *
17  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
18  */
19 public class CoreTest {
20
21         @Test
22         public void markPostKnownMarksPostAsKnown() {
23                 Core core = mock(Core.class);
24                 Post post = mock(Post.class);
25                 MarkPostKnown markPostKnown = core.new MarkPostKnown(post);
26                 markPostKnown.run();
27                 verify(core).markPostKnown(eq(post));
28         }
29
30         @Test
31         public void markReplyKnownMarksReplyAsKnown() {
32                 Core core = mock(Core.class);
33                 PostReply postReply = mock(PostReply.class);
34                 MarkReplyKnown markReplyKnown = core.new MarkReplyKnown(postReply);
35                 markReplyKnown.run();
36                 verify(core).markReplyKnown(eq(postReply));
37         }
38
39 }