Exemple #1
0
        public override string ProcessChange()
        {
            if (Template.Name.ToLower() == "sr")
            {
                XmlNode starNode = GetNode("<star/>");
                Star recursiveStar = new Star(Query, Request, starNode);
                string starContent = recursiveStar.ProcessChange();

                XmlNode sraiNode = GetNode("<srai>" + starContent + "</srai>");
                Srai sraiHandler = new Srai(ChatBot, User, Request, sraiNode);
                return sraiHandler.ProcessChange();
            }
            return string.Empty;
        }
Exemple #2
0
 public void TestSRAIWithValidInput()
 {
     var testNode = StaticHelpers.GetNode("<srai>sraisucceeded</srai>");
     _tagHandler = new Srai(_chatBot, _user, _request, testNode);
     Assert.AreEqual("Test passed.", _tagHandler.ProcessChange());
 }
Exemple #3
0
 public void TestSRAIRecursion()
 {
     var testNode = StaticHelpers.GetNode("<srai>srainested</srai>");
     _tagHandler = new Srai(_chatBot, _user, _request, testNode);
     Assert.AreEqual("Test passed.", _tagHandler.ProcessChange());
 }
Exemple #4
0
 public void TestSRAIEmpty()
 {
     var testNode = StaticHelpers.GetNode("<srai/>");
     _tagHandler = new Srai(_chatBot, _user, _request, testNode);
     Assert.AreEqual("", _tagHandler.ProcessChange());
 }