Пример #1
0
        public void testWithNonExistentPredicate()
        {
            XmlNode testNode          = getNode("<get name=\"nonexistent\"/>");
            var     mockBotTagHandler = new AIMLbot.AIMLTagHandlers.get(this.mockBot, this.mockUser, this.mockQuery, mockRequest, mockResult, testNode);

            Assert.Equal("", mockBotTagHandler.Transform());
        }
Пример #2
0
        public void testWithNoAttributes()
        {
            XmlNode testNode          = getNode("<get/>");
            var     mockBotTagHandler = new AIMLbot.AIMLTagHandlers.get(this.mockBot, this.mockUser, this.mockQuery, mockRequest, mockResult, testNode);

            Assert.Equal("", mockBotTagHandler.Transform());
        }
Пример #3
0
        public void testWithTooManyAttributes()
        {
            XmlNode testNode = StaticHelpers.getNode("<get name=\"we\" value=\"value\" />");

            this.mockBotTagHandler = new AIMLbot.AIMLTagHandlers.get(this.mockBot, this.mockUser, this.mockQuery, this.mockRequest, this.mockResult, testNode);
            Assert.AreEqual("", this.mockBotTagHandler.Transform());
        }
Пример #4
0
        public void testWithGoodData()
        {
            // first element
            XmlNode testNode = StaticHelpers.getNode("<get name=\"name\"/>");
            this.mockBotTagHandler = new AIMLbot.AIMLTagHandlers.get(this.mockBot, this.mockUser, this.mockQuery, this.mockRequest, this.mockResult, testNode);
            Assert.AreEqual("un-named user", this.mockBotTagHandler.Transform());

            // last element
            testNode = StaticHelpers.getNode("<get name=\"we\"/>");
            this.mockBotTagHandler = new AIMLbot.AIMLTagHandlers.get(this.mockBot, this.mockUser, this.mockQuery, this.mockRequest, this.mockResult, testNode);
            Assert.AreEqual("unknown", this.mockBotTagHandler.Transform());
        }
Пример #5
0
        public void testWithGoodData()
        {
            // first element
            XmlNode testNode = StaticHelpers.getNode("<get name=\"name\"/>");
            this.mockBotTagHandler = new AIMLbot.AIMLTagHandlers.get(this.mockBot, this.mockUser, this.mockQuery, this.mockRequest, this.mockResult, testNode);
            Assert.AreEqual("un-named user", this.mockBotTagHandler.Transform());

            // last element
            testNode = StaticHelpers.getNode("<get name=\"we\"/>");
            this.mockBotTagHandler = new AIMLbot.AIMLTagHandlers.get(this.mockBot, this.mockUser, this.mockQuery, this.mockRequest, this.mockResult, testNode);
            Assert.AreEqual("unknown", this.mockBotTagHandler.Transform());
        }
Пример #6
0
 public void testWithNoAttributes()
 {
     XmlNode testNode = StaticHelpers.getNode("<get/>");
     this.mockBotTagHandler = new AIMLbot.AIMLTagHandlers.get(this.mockBot, this.mockUser, this.mockQuery, this.mockRequest, this.mockResult, testNode);
     Assert.AreEqual("", this.mockBotTagHandler.Transform());
 }
Пример #7
0
 public void testWithNonExistentPredicate()
 {
     XmlNode testNode = StaticHelpers.getNode("<get name=\"nonexistent\"/>");
     this.mockBotTagHandler = new AIMLbot.AIMLTagHandlers.get(this.mockBot, this.mockUser, this.mockQuery, this.mockRequest, this.mockResult, testNode);
     Assert.AreEqual("", this.mockBotTagHandler.Transform());
 }