Ejemplo n.º 1
0
        public void RepeatCounterUI_WillCreateAnInstanceListUponCreation_true()
        {
            RepeatCounter model = new RepeatCounter();

            model.CountRepeats("cats", "i just love cats and their little faces", "spaces");
            List <RepeatCounter> models = new List <RepeatCounter>()
            {
            };

            models = RepeatCounter.GetAll();
            Console.WriteLine("You searched for: " + model.GetWord());
            Console.WriteLine("In this sentence: " + model.GetSentence());
            Console.WriteLine("And it matched: " + model.GetCount() + " times");
        }
Ejemplo n.º 2
0
 public HomeModule()
 {
     Get["/"] = _ => {
         return(View["index.cshtml"]);
     };
     Post["/search"] = _ => {
         RepeatCounter model = new RepeatCounter();
         model.CountRepeats(Request.Form["word"], Request.Form["sentence"], Request.Form["command"]);
         List <RepeatCounter> allCounts = new List <RepeatCounter>()
         {
         };
         allCounts = RepeatCounter.GetAll();
         return(View["result.cshtml", allCounts]);
     };
     Post["/boom"] = _ => {
         RepeatCounter model = new RepeatCounter();
         RepeatCounter.ClearAll();
         return(View["cleared.cshtml", model]);
     };
 }