示例#1
0
 public void TestStandardPredicateCollection()
 {
     string[] predicates = {
                               "name", "birthday", "birthplace", "boyfriend", "favoriteband", "favoritebook",
                               "favoritecolor", "favoritefood", "favoritesong", "favoritemovie", "forfun", "friends"
                               , "gender", "girlfriend", "kindmusic", "location", "looklike", "master", "question",
                               "sign", "talkabout", "wear"
                           };
     foreach (string predicate in predicates)
     {
         var tag = $"<bot name=\"{predicate}\" />";
         var testNode = StaticHelpers.GetNode(tag);
         _botTagHandler = new Bot(testNode);
         var transform =_botTagHandler.ProcessChange();
         Assert.AreNotEqual(string.Empty, transform);
     }
 }
示例#2
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="bot">The bot involved in this request</param>
 /// <param name="user">The user making the request</param>
 /// <param name="query">The query that originated this node</param>
 /// <param name="request">The request inputted into the system</param>
 /// <param name="result">The result to be passed to the user</param>
 /// <param name="templateNode">The node to be processed</param>
 public Condition(Bot bot,
                 User user,
                 SubQuery query,
                 Request request,
                 Result result,
                 XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
     isRecursive = false;
 }
示例#3
0
 public void TestTooManyAttributes()
 {
     XmlNode testNode = StaticHelpers.GetNode("<bot name=\"name\" value=\"bad\"/>");
     _botTagHandler = new Bot(testNode);
     Assert.AreEqual("", _botTagHandler.ProcessChange());
 }
示例#4
0
 public void TestNonExistentPredicate()
 {
     XmlNode testNode = StaticHelpers.GetNode("<bot name=\"nonexistent\"/>");
     _botTagHandler = new Bot(testNode);
     Assert.AreEqual("", _botTagHandler.ProcessChange());
 }
示例#5
0
 public void TestExpectedInput()
 {
     XmlNode testNode = StaticHelpers.GetNode("<bot name= \"name\"/>");
     _botTagHandler = new Bot(testNode);
     Assert.AreEqual("un-named user", _botTagHandler.ProcessChange());
 }
示例#6
0
 public void TestBadNodeName()
 {
     XmlNode testNode = StaticHelpers.GetNode("<bad value=\"name\"/>");
     _botTagHandler = new Bot(testNode);
     Assert.AreEqual("", _botTagHandler.ProcessChange());
 }