Example #1
0
        public void SimpleResponderWithMentionRespondsToMention()
        {
            Bot             bot       = new Bot();
            IResponder      responder = bot.RespondsTo("Hi").With("Hello, friend!").IfBotIsMentioned().GetResponder();
            ResponseContext context   = GetResponseContext("Hi, Margie.");

            Assert.AreEqual(true, responder.CanRespond(context));
        }
Example #2
0
        public void SimpleResponderWithMentionDoesntRespondWithoutMention()
        {
            Bot             bot       = new Bot();
            IResponder      responder = bot.RespondsTo("Hi").With("Hello, friend!").IfBotIsMentioned().GetResponder();
            ResponseContext context   = GetResponseContext("Hi, everybody.");

            Assert.AreEqual(false, responder.CanRespond(context));
        }
Example #3
0
        public void SimpleResponderCanRespond()
        {
            Bot             bot       = new Bot();
            IResponder      responder = bot.RespondsTo("Hi").With("Hello, friend!").GetResponder();
            ResponseContext context   = GetResponseContext("Hi everybody.");

            Assert.AreEqual(true, responder.CanRespond(context));
        }