DeserializeService() public method

public DeserializeService ( System.Xml.Linq.XElement xml, ResourceType resourceType ) : Service
xml System.Xml.Linq.XElement
resourceType ResourceType
return Service
Esempio n. 1
0
        public void WebServicesDeserializeServiceWithInvalidJsonExpectedReturnsNewWebService()
        {
            var services = new WebServicesMock();
            var result   = services.DeserializeService("{'root' : 'hello' }");

            Assert.AreEqual(result.ResourceID, Guid.Empty);
        }
Esempio n. 2
0
        public void WebServicesDeserializeServiceWithNullXmlExpectedReturnsNewWebService()
        {
            var services = new WebServicesMock();
            var result   = services.DeserializeService(null, "WebService");

            Assert.AreEqual(result.ResourceID, Guid.Empty);
        }
Esempio n. 3
0
        public void WebServicesDeserializeServiceWithValidXmlExpectedReturnsWebService()
        {
            var xml = XmlResource.Fetch("WebService");

            var services = new WebServicesMock();
            var result   = services.DeserializeService(xml, "WebService");

            WebServiceTests.VerifyEmbeddedWebService(result as WebService);
        }
Esempio n. 4
0
        public void WebServicesDeserializeServiceWithNullJsonExpectedThrowsArgumentNullException()
        {
            var services = new WebServicesMock();

            services.DeserializeService(null);
        }
        public void WebServicesDeserializeServiceWithValidXmlExpectedReturnsWebService()
        {
            var xml = XmlResource.Fetch("WebService");

            var services = new WebServicesMock();
            var result = services.DeserializeService(xml, ResourceType.WebService);

            WebServiceTests.VerifyEmbeddedWebService(result as WebService);
        }
        public void WebServicesDeserializeServiceWithNullXmlExpectedReturnsNewWebService()
        {
            var services = new WebServicesMock();
            var result = services.DeserializeService(null, ResourceType.WebService);

            Assert.AreEqual(result.ResourceID, Guid.Empty);
        }
 public void WebServicesDeserializeServiceWithInvalidJsonExpectedReturnsNewWebService()
 {
     var services = new WebServicesMock();
     var result = services.DeserializeService("{'root' : 'hello' }");
     Assert.AreEqual(result.ResourceID, Guid.Empty);
 }
 public void WebServicesDeserializeServiceWithNullJsonExpectedThrowsArgumentNullException()
 {
     var services = new WebServicesMock();
     services.DeserializeService(null);
 }