🔀 Merge remote-tracking branch 'origin/master'
[xudocci.git] / src / test / java / net / pterodactylus / xdcc / data / BotTest.java
1 package net.pterodactylus.xdcc.data;
2
3 import static org.hamcrest.MatcherAssert.*;
4 import static org.hamcrest.Matchers.*;
5
6 import org.hamcrest.MatcherAssert;
7 import org.hamcrest.Matchers;
8 import org.junit.Test;
9 import org.mockito.Mockito;
10
11 /**
12  * Unit test for {@link Bot}.
13  *
14  * @author <a href="mailto:bombe@pterodactylus.net">David â€˜Bombe’ Roden</a>
15  */
16 public class BotTest {
17
18         private final Network network = Mockito.mock(Network.class);
19         private final Bot bot = new Bot(network, "#test", "Test-Bot");
20         private final Pack oldPack = new Pack("7", "123", "new-file.dat");
21         private final Pack newPack = new Pack("15", "234", "new-file.dat");
22
23         @Test
24         public void addingOneFileWithTwoIdsRemovesTheOldId() {
25                 bot.addPack(oldPack);
26                 bot.addPack(newPack);
27                 assertThat(bot.packs(), contains(newPack));
28         }
29
30 }