Exemple #1
0
        public void ReadPrimitivePropertiesHappyPath()
        {
            var graph = new PluginGraph();

            graph.FindFamily(typeof(Rule)).AddPlugin(typeof(ComplexRule));

            MemoryInstanceMemento memento = ComplexRule.GetMemento();

            memento.SetProperty(XmlConstants.PLUGGED_TYPE, typeof(ComplexRule).AssemblyQualifiedName);

            var instance = (IConfiguredInstance)memento.ReadInstance(graph, typeof(Rule));


            Assert.AreEqual(memento.GetProperty("String"), instance.GetProperty("String"));
            Assert.AreEqual(memento.GetProperty("Breed"), instance.GetProperty("Breed"));
            Assert.AreEqual(memento.GetProperty("Int"), instance.GetProperty("Int"));
            Assert.AreEqual(memento.GetProperty("Long"), instance.GetProperty("Long"));
            Assert.AreEqual(memento.GetProperty("Byte"), instance.GetProperty("Byte"));
            Assert.AreEqual(memento.GetProperty("Double"), instance.GetProperty("Double"));
            Assert.AreEqual(memento.GetProperty("Bool"), instance.GetProperty("Bool"));
        }