예제 #1
0
        public HomeModule()
        {
            Get["/"] = _ => View["index.cshtml"];

            Post["/result"] = _ =>
            {
                RepeatCounter counter = new RepeatCounter();
                return(View["result.cshtml", counter.CounterRepeats(Request.Form["userWord"], Request.Form["userStrings"])]);
            };
        }
예제 #2
0
 public void RepeatCounterCheck_ForUserInput_0()
 {
   RepeatCounter repeatCounterTest = new RepeatCounter();
   Assert.Equal(0, repeatCounterTest.CounterRepeats("", ""));
 }
예제 #3
0
 public void RepeatCounterCheck_ForUserInputHELLO_HerloHEllohelloHELLO_2()
 {
   RepeatCounter repeatCounterTest = new RepeatCounter();
   Assert.Equal(3, repeatCounterTest.CounterRepeats("HELLO", "Herlo HEllo hello HELLO"));
 }
예제 #4
0
 public void RepeatCounterCheck_ForUserInputHello_HelloGoodbyeHello_2()
 {
   RepeatCounter repeatCounterTest = new RepeatCounter();
   Assert.Equal(2, repeatCounterTest.CounterRepeats("Hello", "Hello Goodbye Hello"));
 }