public void PayloadReaderReadsNullTermString() { var msg = new ClientMsg <MsgClientChatEnter>(BuildStructMsg()); string chatName = msg.ReadNullTermString(); Assert.Equal(chatName, "Saxton Hell"); }
public void PayloadReaderReadsNullTermString() { var msg = new ClientMsg<MsgClientChatEnter>( BuildStructMsg() ); string chatName = msg.ReadNullTermString(); Assert.Equal( chatName, "Saxton Hell" ); }
public void PayloadReaderDoesNotOverflowPastNullTermString() { var msg = new ClientMsg <MsgClientChatEnter>(BuildStructMsg()); string chatName = msg.ReadNullTermString(); Assert.Equal(chatName, "Saxton Hell"); byte nextByte = msg.ReadByte(); char mByte = (char)msg.ReadByte(); // next byte should be a null Assert.Equal(nextByte, 0); // and the one after should be the beginning of a MessageObject Assert.Equal(mByte, 'M'); }
public void PayloadReaderDoesNotOverflowPastNullTermString() { var msg = new ClientMsg<MsgClientChatEnter>( BuildStructMsg() ); string chatName = msg.ReadNullTermString(); Assert.Equal( chatName, "Saxton Hell" ); byte nextByte = msg.ReadByte(); char mByte = (char)msg.ReadByte(); // next byte should be a null Assert.Equal( nextByte, 0 ); // and the one after should be the beginning of a MessageObject Assert.Equal( mByte, 'M' ); }