Exemplo n.º 1
0
        public void TestString()
        {
            _sendBridgeStream.Write("şerhat");
            var data = _sendBridgeStream.Encode();

            var receivePacket = new BridgeStream(data);
            var sendValue     = receivePacket.ReadString();

            Assert.AreEqual("şerhat", sendValue);
        }
Exemplo n.º 2
0
        public void TestHasMore()
        {
            _sendBridgeStream.Write("Ferhat");
            _sendBridgeStream.Write("Ferhat");
            _sendBridgeStream.Write("Ferhat");
            _sendBridgeStream.Write("Ferhat");
            _sendBridgeStream.Write("Ferhat");

            var data = _sendBridgeStream.Encode();

            var receivePacket = new BridgeStream(data);

            var readCount = 0;

            while (receivePacket.HasMore)
            {
                receivePacket.ReadString();
                readCount++;
            }

            Assert.AreEqual(5, readCount);
        }