ReadByte() public method

public ReadByte ( ) : byte
return byte
Example #1
0
        public void CanReceiveByte()
        {
            byte expected = 0x03;

            Session session = new Session("localhost", DefaultPort);
            AcceptAndSendBytes(new byte[] { expected });

            byte actual = session.ReadByte();
            session.Close();

            Assert.AreEqual(expected, actual);
        }
Example #2
0
 public void ThrowsExceptionTryingToReadByteOnClosed()
 {
     Session session = new Session("localhost", DefaultPort);
     server.AcceptTcpClient().Close();
     Assert.Throws<SocketException>(() => session.ReadByte());
 }