public void ProperDeserialization() { var store = new DefaultConfigurationStore(); var interpreter = new XmlInterpreter(new ConfigResource()); IKernel kernel = new DefaultKernel(); interpreter.ProcessResource(interpreter.Source, store, kernel); Assert.AreEqual(2, store.GetFacilities().Length); Assert.AreEqual(4, store.GetComponents().Length); var config = store.GetFacilityConfiguration(typeof(NoopFacility).FullName); var childItem = config.Children["item"]; Assert.IsNotNull(childItem); Assert.AreEqual("value", childItem.Value); config = store.GetFacilityConfiguration(typeof(Noop2Facility).FullName); Assert.IsNotNull(config); Assert.AreEqual("value within CDATA section", config.Value); config = store.GetComponentConfiguration("testidcomponent1"); childItem = config.Children["item"]; Assert.IsNotNull(childItem); Assert.AreEqual("value1", childItem.Value); config = store.GetComponentConfiguration("testidcomponent2"); childItem = config.Children["item"]; Assert.IsNotNull(childItem); Assert.AreEqual("value2", childItem.Value); }
public void ProperDeserialization() { DefaultConfigurationStore store = new DefaultConfigurationStore(); XmlInterpreter interpreter = new XmlInterpreter(new ConfigResource()); interpreter.ProcessResource(interpreter.Source, store); Assert.AreEqual(2, store.GetFacilities().Length); Assert.AreEqual(2, store.GetComponents().Length); IConfiguration config = store.GetFacilityConfiguration("testidengine"); IConfiguration childItem = config.Children["item"]; Assert.IsNotNull(childItem); Assert.AreEqual("value", childItem.Value); config = store.GetFacilityConfiguration("testidengine2"); Assert.IsNotNull(config); Assert.AreEqual("value within CDATA section", config.Value); config = store.GetComponentConfiguration("testidcomponent1"); childItem = config.Children["item"]; Assert.IsNotNull(childItem); Assert.AreEqual("value1", childItem.Value); config = store.GetComponentConfiguration("testidcomponent2"); childItem = config.Children["item"]; Assert.IsNotNull(childItem); Assert.AreEqual("value2", childItem.Value); }
public void ProperDeserialization() { var store = new DefaultConfigurationStore(); var interpreter = new XmlInterpreter(Xml.Embedded("sample_config_complex.xml")); IKernel kernel = new DefaultKernel(); interpreter.ProcessResource(interpreter.Source, store, kernel); Assert.AreEqual(2, store.GetFacilities().Length); Assert.AreEqual(2, store.GetComponents().Length); Assert.AreEqual(2, store.GetConfigurationForChildContainers().Length); var config = store.GetFacilityConfiguration(typeof(DummyFacility).FullName); var childItem = config.Children["item"]; Assert.IsNotNull(childItem); Assert.AreEqual("value", childItem.Value); config = store.GetFacilityConfiguration(typeof(HiperFacility).FullName); Assert.IsNotNull(config); Assert.AreEqual("value within CDATA section", config.Value); config = store.GetComponentConfiguration("testidcomponent1"); childItem = config.Children["item"]; Assert.IsNotNull(childItem); Assert.AreEqual("value1", childItem.Value); config = store.GetComponentConfiguration("testidcomponent2"); childItem = config.Children["item"]; Assert.IsNotNull(childItem); Assert.AreEqual("value2", childItem.Value); config = store.GetChildContainerConfiguration("child1"); Assert.IsNotNull(config); Assert.AreEqual(config.Attributes["name"], "child1"); Assert.AreEqual("<configuration />", config.Value); config = store.GetChildContainerConfiguration("child2"); Assert.IsNotNull(config); Assert.AreEqual(config.Attributes["name"], "child2"); Assert.AreEqual("<configuration />", config.Value); }