Beispiel #1
0
        public void TestRemoteMethodResponseSerialization_MissingResponseValueElement()
        {
            var response = new RemoteMethodResponse();

            response.ComponentName = "component";
            response.CallId        = Guid.NewGuid();
            response.ResponseValue = null;

            var xml = response.Serialize();

            xml.Elements(XName.Get("ResponseValue", xml.Name.NamespaceName)).Remove();

            var roundtrip = new RemoteMethodResponse();

            Assert.IsFalse(roundtrip.Validate(xml));
        }
Beispiel #2
0
        public void TestRemoteMethodResponseSerialization_NullResponse()
        {
            var response = new RemoteMethodResponse();

            response.ComponentName = "component";
            response.CallId        = Guid.NewGuid();
            response.ResponseValue = null;

            var xml = response.Serialize();


            var roundtrip = new RemoteMethodResponse();

            Assert.IsTrue(roundtrip.Validate(xml));
            roundtrip.Deserialize(xml);

            Assert.IsNotNull(roundtrip);
            Assert.AreEqual <Guid>(response.CallId, roundtrip.CallId);
            Assert.AreEqual <string>(response.ComponentName, roundtrip.ComponentName);
            Assert.IsNull(roundtrip.ResponseValue);
        }