Inheritance: Zetetic.Chain.CatalogBase, ICatalog
Example #1
0
        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;
        }
Example #2
0
 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);
 }
Example #3
0
        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");

        }
Example #4
0
 public XmlCatalogAndMetadata(XmlCatalog catalog)
 {
     this.Catalog = catalog;
 }