示例#1
0
        public void RepeatCount_GetsCount_ReturnsCount()
        {
            //arrange
            RepeatCounterGenerator newRepeatCounterGenerator = new RepeatCounterGenerator("BUFFalo bUffalo buffalo buffalo", "buffalo", "buffalo buffalo buffalo buffalo");
            int testInt = 4;
            //act
            int testInput = newRepeatCounterGenerator.RepeatCount();

            //assert
            Assert.AreEqual(testInt, testInput);
        }
示例#2
0
        public ActionResult Result()
        {
            string inputString = Request.Form["input-string"];
            string findString  = Request.Form["find-string"];
            string lowerInput  = inputString.ToLower();
            RepeatCounterGenerator newRepeatCounterGenerator = new RepeatCounterGenerator(inputString, findString, lowerInput);

            newRepeatCounterGenerator.LowerCase();
            newRepeatCounterGenerator.BreakString();
            int displayString = newRepeatCounterGenerator.RepeatCount();


            return(View("Index", displayString));
        }