Files
Party-Parrots-At-Sea/src/test/java/seng302/server/TestHeader.java
T
Michael Rausch 3e97f016d5 Getting boat locations from race simulator & bug fixes
- Boat locations that are generated by the simulator are sent to the client as they happen
- Fixed heading and lat/lon encoding
- Fixed a bug where the header wasn't included in the sent byte stream
- Fixed the format of data as it's sent to the client.
- Data is now sent using a channel
- Removed tests that don't work with channels

Tags: #story[829]
2017-04-29 19:38:21 +12:00

27 lines
616 B
Java

package seng302.server;
import org.junit.Test;
import seng302.server.messages.*;
import static junit.framework.TestCase.assertTrue;
/**
* Tests message header
*/
public class TestHeader {
@Test
public void testHeaderSizeEqualsActualSize(){
Header h = new Header(MessageType.DISPLAY_TEXT_MESSAGE, 1, (short) 1);
assertTrue(h.getSize() == h.getByteBuffer().array().length);
}
@Test
public void headerSizeIsSameAsSpec(){
Header h = new Header(MessageType.DISPLAY_TEXT_MESSAGE, 1, (short) 1);
assertTrue(h.getSize() == 15); // Spec specifies 15 bytes
}
}