public void TwoConsecutiveCallsWhichReturnsMessageBuffersShouldNotBeSame() { var message = new WindowInfo(56, 67, 60, 71); var messageBuffer1 = message.ToBytes(); var messageBuffer2 = message.ToBytes(); Assert.AreNotSame(messageBuffer1, messageBuffer2); }
public void ShouldAbleToBytesFromRetriveVariables() { var message = new WindowInfo(56, 67, 60, 71); var messageBuffer = new byte[] { 56, 0, 0, 0, 67, 0, 0, 0, 60, 0, 0, 0, 71, 0, 0, 0 }; var messageBufferToCompare = message.ToBytes(); Assert.AreEqual(messageBuffer.Length, messageBufferToCompare.Length); for (var i = 0; i < messageBuffer.Length; i++) { if (messageBuffer[i] != messageBufferToCompare[i]) Assert.Fail("Message contents is not same"); } }