mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Implemented server re-registration when a server closes / updates
- When a server is closed, it will disappear from the server list - When a player joins a server, the number of spaces left will decrease - Servers now disappear instead of duplicating - Added tests for ServerDescription - Added documentation for new classes Tags: #story[1247]
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
package seng302.gameServer.server;
|
||||
|
||||
import org.junit.Test;
|
||||
import seng302.gameServer.ServerDescription;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class TestServerDesc {
|
||||
@Test
|
||||
public void testEquals(){
|
||||
ServerDescription one = new ServerDescription("a", "b", 10, "asd", 1234);
|
||||
ServerDescription two = new ServerDescription("a", "b", 10, "asd", 1234);
|
||||
|
||||
assertTrue(one.equals(two));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotEqualName(){
|
||||
ServerDescription one = new ServerDescription("a", "b", 10, "asd", 1234);
|
||||
ServerDescription two = new ServerDescription("a2", "b", 10, "asd", 1234);
|
||||
|
||||
assertTrue(!one.equals(two));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotEqualMap(){
|
||||
ServerDescription one = new ServerDescription("a", "b", 10, "asd", 1234);
|
||||
ServerDescription two = new ServerDescription("a", "ba", 10, "asd", 1234);
|
||||
|
||||
assertTrue(!one.equals(two));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotEqualPort(){
|
||||
ServerDescription one = new ServerDescription("a", "b", 10, "asd", 1234);
|
||||
ServerDescription two = new ServerDescription("a", "b", 10, "asd", 12341);
|
||||
|
||||
assertTrue(!one.equals(two));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotEqualAddress(){
|
||||
ServerDescription one = new ServerDescription("a", "b", 10, "as1d", 1234);
|
||||
ServerDescription two = new ServerDescription("a", "b", 10, "asd", 1234);
|
||||
|
||||
assertTrue(!one.equals(two));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user