示例#1
0
        public void EchoProtocolMethodSyncTest()
        {
            //Arrange
            var          log      = new Mock <ILogger>();
            EchoProtocol protocol = new EchoProtocol();

            //Act
            var result = protocol.SendRequestAsync(log.Object).Result;

            //Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.GetStatus);
        }
示例#2
0
        public async Task EchoProtocolMethodASyncTest()
        {
            //Arrange
            var          log      = new Mock <ILogger>();
            EchoProtocol protocol = new EchoProtocol()
            {
                HostName = "online.gameroom.ru"
            };

            //Act
            var result = await protocol.SendRequestAsync(log.Object);

            //Assert
            Assert.IsNotNull(result);
            Assert.IsFalse(result.GetStatus);
        }