Example #1
0
        public void CanProcessString()
        {
            Kyameru.Core.BaseComponents.AddHeader header = new Core.BaseComponents.AddHeader("Processing", "String");
            Routable routable = new Routable(new Dictionary <string, string>(), "Test");

            header.Process(routable);
            Assert.AreEqual("String", routable.Headers["Processing"]);
        }
Example #2
0
        public void CanProcessCallbackOne()
        {
            Kyameru.Core.BaseComponents.AddHeader header = new Core.BaseComponents.AddHeader("Processing", () =>
            {
                return("CallbackOne");
            });
            Routable routable = new Routable(new Dictionary <string, string>(), "Test");

            header.Process(routable);
            Assert.AreEqual("CallbackOne", routable.Headers["Processing"]);
        }
Example #3
0
        public void SetErrorWorks()
        {
            Kyameru.Core.BaseComponents.AddHeader header = new Core.BaseComponents.AddHeader("Processing", (x) =>
            {
                throw new NotImplementedException();
            });
            Routable routable = new Routable(new Dictionary <string, string>()
            {
                { "Target", "drive" }
            }, "Test");

            header.Process(routable);
            Assert.NotNull(routable.Error);
        }
Example #4
0
        public void CanProcessCallbackTwo()
        {
            Kyameru.Core.BaseComponents.AddHeader header = new Core.BaseComponents.AddHeader("Processing", (x) =>
            {
                return(x.Headers["Target"]);
            });
            Routable routable = new Routable(new Dictionary <string, string>()
            {
                { "Target", "drive" }
            }, "Test");

            header.Process(routable);
            Assert.AreEqual("drive", routable.Headers["Processing"]);
        }