DeserializeService() 공개 메소드

public DeserializeService ( System.Xml.Linq.XElement xml, ResourceType resourceType ) : Service
xml System.Xml.Linq.XElement
resourceType ResourceType
리턴 Service
예제 #1
0
        public void PluginServicesDeserializeServiceWithValidXmlExpectedReturnsPluginService()
        {
            var xml = XmlResource.Fetch("PluginService");

            var services = new PluginServicesMock();
            var result   = services.DeserializeService(xml, "PluginService");

            PluginServiceTests.VerifyEmbeddedPluginService(result as PluginService);
        }
        public void PluginServicesDeserializeServiceWithValidJsonExpectedReturnsPluginService()
        {
            var xml = XmlResource.Fetch("PluginService");
            var service = new PluginService(xml);

            var services = new PluginServicesMock();
            var result = services.DeserializeService(service.ToString());

            PluginServiceTests.VerifyEmbeddedPluginService(result as PluginService);
        }
예제 #3
0
        public void PluginServicesDeserializeServiceWithNullJsonExpectedThrowsArgumentNullException()
        {
            var services = new PluginServicesMock();

            services.DeserializeService(null);
        }
        public void PluginServicesDeserializeServiceWithNullXmlExpectedReturnsNewPluginService()
        {
            var services = new PluginServicesMock();
            var result = services.DeserializeService(null, ResourceType.PluginService);

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