示例#1
0
        public void BlankHeaderErrors()
        {
            SlackTo  slackTo  = this.GetComponent("Header", this.SetupOkHandler());
            Routable routable = new Routable(new Dictionary <string, string>(), "This is a slack message");

            slackTo.Process(routable);
            Assert.NotNull(routable.Error);
        }
示例#2
0
        public void SendMessageInError()
        {
            SlackTo  slackTo  = this.GetComponent("Body", this.SetupErrorHandler());
            Routable routable = new Routable(new Dictionary <string, string>(), "This is a slack message");

            slackTo.Process(routable);
            Assert.NotNull(routable.Error);
        }
示例#3
0
        public void LoggingIsTriggered()
        {
            bool     callbackMade = false;
            SlackTo  slackTo      = this.GetComponent("Body", this.SetupOkHandler());
            Routable routable     = new Routable(new Dictionary <string, string>(), "This is a slack message");

            slackTo.OnLog += delegate(object sender, Log log) {
                callbackMade = true;
            };
            slackTo.Process(routable);
            Assert.IsTrue(callbackMade);
        }
示例#4
0
        public void CanSendMessageFromHeader()
        {
            Dictionary <string, string> headers = new Dictionary <string, string>()
            {
                { "SlackMessage", "test" }
            };
            SlackTo  slackTo  = this.GetComponent("Header", this.SetupOkHandler());
            Routable routable = new Routable(headers, "This is a slack message");

            slackTo.Process(routable);
            Assert.IsNull(routable.Error);
        }