Пример #1
0
 public void SimpleStringIsWritten()
 {
     var testSocket = new TestSocket();
     var socketStream = new SocketStream(testSocket);
     socketStream.Write("hello");
     Assert.AreEqual(new byte[] {104, 101, 108, 108, 111}, testSocket.GetBytes());
 }
Пример #2
0
 public void StringIsWrittenWithLengthPrefix()
 {
     var testSocket = new TestSocket();
     var socketStream = new SocketStream(testSocket);
     socketStream.Write("h\u2019llo", "{0}:");
     Assert.AreEqual(new byte[] {55, 58, 104, 226, 128, 153, 108, 108, 111}, testSocket.GetBytes());
 }
Пример #3
0
 public Messenger(SocketModel socket)
 {
     this.socket = socket;
     stream = new SocketStream(socket);
     stream.Write("Slim -- V0.0\n");
 }