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); } }
/// <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; }
public void TestTooManyAttributes() { XmlNode testNode = StaticHelpers.GetNode("<bot name=\"name\" value=\"bad\"/>"); _botTagHandler = new Bot(testNode); Assert.AreEqual("", _botTagHandler.ProcessChange()); }
public void TestNonExistentPredicate() { XmlNode testNode = StaticHelpers.GetNode("<bot name=\"nonexistent\"/>"); _botTagHandler = new Bot(testNode); Assert.AreEqual("", _botTagHandler.ProcessChange()); }
public void TestExpectedInput() { XmlNode testNode = StaticHelpers.GetNode("<bot name= \"name\"/>"); _botTagHandler = new Bot(testNode); Assert.AreEqual("un-named user", _botTagHandler.ProcessChange()); }
public void TestBadNodeName() { XmlNode testNode = StaticHelpers.GetNode("<bad value=\"name\"/>"); _botTagHandler = new Bot(testNode); Assert.AreEqual("", _botTagHandler.ProcessChange()); }