Пример #1
0
 public HomeModule()
 {
     Get["/"] = _ => {
     string result = "";
     return View["index.cshtml", result];
       };
       Post["/"] = _ => {
     FindAndReplaceWord newFindAndReplaceWord = new FindAndReplaceWord(Request.Form["input1"], Request.Form["input2"], Request.Form["input3"]);
     string result = newFindAndReplaceWord.GetResults();
     return View["index.cshtml", result];
       };
 }
        public void Test2_IfInput2ReplacesMultipleInputs_ReturnInput3()
        {
            //Arrange
              string input1 = "Once upon a time there was a dude named Simon. simon was really cool.";
              string input2 = "Simon";
              string input3 = "Will";
              FindAndReplaceWord testWord = new FindAndReplaceWord(input1, input2, input3);

              //Act
              string result = testWord.GetResults();

              //Assert
              Assert.Equal("Once upon a time there was a dude named Will. Will was really cool.", result);
        }
        public void Test1_IfInput2ReplacesInput3_ReturnInput3()
        {
            //Arrange
              string input1 = "Hello";
              string input2 = "Hello";
              string input3 = "Goodbye";
              FindAndReplaceWord testWord = new FindAndReplaceWord(input1, input2, input3);

              //Act
              string result = testWord.GetResults();

              //Assert
              Assert.Equal("Goodbye", result);
        }