Пример #1
0
        public void ConnectedResultFilter_HandleReturnObject_UnknownMessage()
        {
            var connectedResultFilter = new ConnectedResultFilter();

            var ping = new Ping();

            var returnedObject = new ReturnedObject("ping", JObject.FromObject(ping), JsonConvert.SerializeObject(ping));

            connectedResultFilter.HandleReturnObject(returnedObject);

            Assert.IsFalse(connectedResultFilter.IsCompleted());
            Assert.IsNull(connectedResultFilter.GetReturnedObject());
        }
Пример #2
0
        public void ConnectedResultFilter_HandleReturnObject_FailedMessage()
        {
            var connectedResultFilter = new ConnectedResultFilter();

            var failed = new Failed() {Version = "1"};

            var returnedObject = new ReturnedObject("failed", JObject.FromObject(failed),
                JsonConvert.SerializeObject(failed));

            connectedResultFilter.HandleReturnObject(returnedObject);

            Assert.IsTrue(connectedResultFilter.IsCompleted());
            Assert.AreEqual(returnedObject, connectedResultFilter.GetReturnedObject());
        }