public ActionResult Result() { string testWord = Request.Form["testWord"]; string targetString = Request.Form["targetString"]; RepeatCounter newRepeatCounter = new RepeatCounter(); newRepeatCounter.SetTargetStringList(targetString); newRepeatCounter.SetTestWord(testWord); newRepeatCounter.SetRemovals(); newRepeatCounter.CleanTargetStrings(); newRepeatCounter.CompareStrings(); return(View("Index", newRepeatCounter)); }
public void CleanTargetStrings_RemoveAsterix_Green() { //arrange RepeatCounter newRepeatCounter = new RepeatCounter(); //action newRepeatCounter.SetTargetStringList("Hell*o"); newRepeatCounter.CleanTargetStrings(); List <string> testingList = newRepeatCounter.GetTargetStringList(); string TargetStringListIndexZero = testingList[0]; //assert Assert.AreEqual("Hello", TargetStringListIndexZero); }
public void CompareStrings_TestWordWithExclusion_Green() { //arrange RepeatCounter newRepeatCounter = new RepeatCounter(); //action newRepeatCounter.SetTestWord(" #Hello "); newRepeatCounter.SetTargetStringList("#He$llo #H@ello hello @@way! &**) yay day"); newRepeatCounter.SetRemovals(); newRepeatCounter.CleanTargetStrings(); newRepeatCounter.CompareStrings(); int repeatInt = newRepeatCounter.GetRepeats(); //assert Assert.AreEqual(2, repeatInt); }
public void CompareStrings_CounterToTwo_Green() { //arrange RepeatCounter newRepeatCounter = new RepeatCounter(); //action newRepeatCounter.SetTestWord(" Hello "); string test = newRepeatCounter.GetTestWord(); newRepeatCounter.SetTargetStringList("Hell*o H@ello"); newRepeatCounter.CleanTargetStrings(); List <string> testList = newRepeatCounter.GetTargetStringList(); newRepeatCounter.CompareStrings(); int repeatInt = newRepeatCounter.GetRepeats(); //assert Assert.AreEqual(2, repeatInt); }