public void TestBuild_WithParams() { DudInterpreter interpreter = new DudInterpreter(); IDictionary <string, IPipelineXmlInterpreter> factories = new Dictionary <string, IPipelineXmlInterpreter>(); factories.Add("Test", interpreter); PipelinePersistanceProcess p = new PipelinePersistanceProcess(factories); AlgorithmDefinition d = new AlgorithmDefinition("Test", new Property[] { }); d.ParameterObject = new Cloneable(); XElement xml = p.Build(d); Assert.IsTrue(xml.Descendants("properties").Any()); Assert.IsTrue(interpreter.DidCallCreateXml); }
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); }