This repository has been archived by the owner on May 13, 2020. It is now read-only.
generated from cryptic-game/microservice-java-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated SonarCloud Stuff in Class Channel. (#1)
- Loading branch information
1 parent
fe49418
commit 5507f3b
Showing
1 changed file
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,10 +35,17 @@ public void testAddUser() { | |
final Channel channel = new Channel("test"); | ||
final User testUser = new User(UUID.randomUUID(), "test", "[email protected]", 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", "[email protected]", new Date(), new Date()); | ||
|
||
assertTrue(channel.addUser(testUser)); | ||
} | ||
|
||
@Test | ||
public void testDupedAddUser() { | ||
final Channel channel = new Channel("test"); | ||
|
@@ -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", "[email protected]", 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"); | ||
|