Beispiel #1
0
 public ActionResult Index(TextMatchInputModel textMatchInputModel)
 {
     if (ModelState.IsValid)
     {
         return RedirectToAction("Index", "Matches", new { text = textMatchInputModel.Text, subText = textMatchInputModel.SubText });
     }
     return View(textMatchInputModel);
 }
 public void can_get_index_happy_path()
 {
     var homeController = new MatchesController(_textMatchService);
     var textMatchInputModel = new TextMatchInputModel
     {
         SubText = "Polly",
         Text = _testText
     };
     var indexPage = homeController.Index(textMatchInputModel.Text, textMatchInputModel.SubText) as ViewResult;
     var model = (TextMatchOutputModel) indexPage.Model;
     model.Output.Should().Be("1,26,51");
 }