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

Commit

Permalink
Updated SonarCloud Stuff in Class Channel. (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding committed Oct 30, 2019
1 parent fe49418 commit 5507f3b
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,17 @@ public void testAddUser() {
final Channel channel = new Channel("test");
final User testUser = new User(UUID.randomUUID(), "test", "test@test.test", new Date(), new Date());

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

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

assertTrue(channel.addUser(testUser));
}

@Test
public void testDupedAddUser() {
final Channel channel = new Channel("test");
Expand All @@ -57,10 +64,22 @@ public void testRemoveUser() {
fail();
}

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

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

if (!channel.getUsers().contains(testUser)) {
fail();
}

assertTrue(channel.removeUser(testUser));
}

@Test
public void testRemoveUserWithoutExist() {
final Channel channel = new Channel("test");
Expand Down

0 comments on commit 5507f3b

Please sign in to comment.