public void MyTestInitialize() { _catalog = new XmlCatalog(); ICommand cmd = new HelloCommandWProp() { SomethingExtra = "howdy", Name = "cmd" }; _catalog[cmd.Name] = cmd; IChain chain = ChainFactory.GetFactory().CreateChain(); chain.Name = "chain"; chain.Add(new HelloCommandWProp() { ShouldTerminateChain = true }); IChain innerChain = ChainFactory.GetFactory().CreateChain(); innerChain.Add(new AnotherCommand()); chain.Add(innerChain); _catalog[chain.Name] = chain; }
public void XmlCatalogDeSerializationTest() { System.Xml.Serialization.XmlSerializer ser = new System.Xml.Serialization.XmlSerializer(typeof(XmlCatalog)); using (System.IO.FileStream fs = new System.IO.FileStream(@"c:\temp\xmlcat.xml", System.IO.FileMode.Open)) { _catalog = (XmlCatalog)ser.Deserialize(fs); } ICommand cmd = _catalog["cmd"]; Assert.IsNotNull(cmd); }
public void CatalogShouldRefuseMissingRequiredProperties() { IContext ctx = new ContextBase(); Zetetic.Chain.Generic.CopyCommand cmd = new Zetetic.Chain.Generic.CopyCommand(); ctx["in"] = "value"; cmd.FromKey = null; cmd.ToKey = "out"; cmd.Name = "test"; ICatalog cat = new XmlCatalog(); cat[cmd.Name] = cmd; Assert.Fail("Should have had exception"); }
public XmlCatalogAndMetadata(XmlCatalog catalog) { this.Catalog = catalog; }