Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
Updated Tests. (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding committed Oct 30, 2019
1 parent f60d43b commit 4ad0dcd
Showing 1 changed file with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,19 @@ public void testSetName() {
public void testAddUser() {
final Channel channel = new Channel("test");
final User testUser = new User(UUID.randomUUID(), "test", "test@test.test", new Date(), new Date());
channel.addUser(testUser);

assertTrue(channel.addUser(testUser));
assertTrue(channel.getUsers().contains(testUser));
}

@Test
public void testDupedAddUser() {
final Channel channel = new Channel("test");
final User testUser = new User(UUID.randomUUID(), "test", "test@test.test", new Date(), new Date());
channel.addUser(testUser);
assertFalse(channel.addUser(testUser));
}

@Test
public void testRemoveUser() {
final Channel channel = new Channel("test");
Expand All @@ -49,8 +57,15 @@ public void testRemoveUser() {
fail();
}

channel.removeUser(testUser);

assertTrue(channel.removeUser(testUser));
assertFalse(channel.getUsers().contains(testUser));
}

@Test
public void testRemoveUserWithoutExist() {
final Channel channel = new Channel("test");
final User testUser = new User(UUID.randomUUID(), "test", "test@test.test", new Date(), new Date());

assertFalse(channel.removeUser(testUser));
}
}

0 comments on commit 4ad0dcd

Please sign in to comment.