Exemple #1
0
        public void TestDecompile_NotXElement()
        {
            IDictionary <string, IPipelineXmlInterpreter> factories = new Dictionary <string, IPipelineXmlInterpreter>();

            factories.Add("Test", new DudInterpreter());
            PipelineXmlDecompiler decompiler = new PipelineXmlDecompiler(factories);
            XText element = new XText("Test");

            decompiler.DecompileAlgorithm(element);
        }
Exemple #2
0
        public void TestDecompile_NoProperties()
        {
            string name = "Test";
            IDictionary <string, IPipelineXmlInterpreter> factories = new Dictionary <string, IPipelineXmlInterpreter>();

            factories.Add("Test", new DudInterpreter());
            PipelineXmlDecompiler decompiler = new PipelineXmlDecompiler(factories);
            XNode element = new XElement("process", new XAttribute("name", name));
            var   d       = decompiler.DecompileAlgorithm(element);

            Assert.AreEqual(name, d.AlgorithmName);
            Assert.IsNull(d.ParameterObject);
        }
Exemple #3
0
        public void TestDecompile_UnknownProcess()
        {
            string name = "Unknown";
            IDictionary <string, IPipelineXmlInterpreter> factories = new Dictionary <string, IPipelineXmlInterpreter>();

            factories.Add("Test", new DudInterpreter());
            PipelineXmlDecompiler decompiler = new PipelineXmlDecompiler(factories);
            XNode element = new XElement(
                "process", new XAttribute("name", name),
                new XElement("properties",
                             new XElement("property",
                                          new XAttribute("name", "test"),
                                          new XAttribute("value", "1"))));

            decompiler.DecompileAlgorithm(element);
        }
Exemple #4
0
        public void TestDecompile_WithProperty()
        {
            string name = "Test";
            IDictionary <string, IPipelineXmlInterpreter> factories = new Dictionary <string, IPipelineXmlInterpreter>();
            DudInterpreter i = new DudInterpreter();

            factories.Add("Test", i);
            PipelineXmlDecompiler decompiler = new PipelineXmlDecompiler(factories);
            XNode element = new XElement(
                "process", new XAttribute("name", name),
                new XElement("properties",
                             new XElement("property",
                                          new XAttribute("name", "test"),
                                          new XAttribute("value", "1"))));
            var d = decompiler.DecompileAlgorithm(element);

            Assert.IsNotNull(d.ParameterObject);
            Assert.IsTrue(i.DidCallCreateObject);
        }