ReadByte() public method

public ReadByte ( ) : byte
return byte
Exemplo n.º 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);
        }
Exemplo n.º 2
0
 public void ThrowsExceptionTryingToReadByteOnClosed()
 {
     Session session = new Session("localhost", DefaultPort);
     server.AcceptTcpClient().Close();
     Assert.Throws<SocketException>(() => session.ReadByte());
 }