[Test] public void SimpleStringIsWritten() { var testSocket = new TestPort(); var socketStream = new MessageChannel(testSocket); socketStream.Write("hello"); Assert.AreEqual(new byte[] { 104, 101, 108, 108, 111 }, testSocket.GetBytes()); }
[Test] public void StringIsWrittenWithLengthPrefix() { var testSocket = new TestPort(); var socketStream = new MessageChannel(testSocket); socketStream.Write("h\u2019llo", "{0}:"); Assert.AreEqual(new byte[] { 55, 58, 104, 226, 128, 153, 108, 108, 111 }, testSocket.GetBytes()); }
public Messenger(MessageChannel channel) { this.channel = channel; channel.Write("Slim -- V0.5\n"); }