public void WithPermanent_GivenExpectedUrl_ShouldPass() { ActionResult result = new RedirectResult("/abc", true); result.Should().BeRedirectResult() .WithPermanent(true); }
public void WithUrl_GivenExpectedUrl_ShouldPass() { ActionResult result = new RedirectResult("/abc"); result.Should().BeRedirectResult() .WithUrl("/abc"); }
public void WithPermanent_GivenUnexpectedUrl_ShouldFail() { ActionResult result = new RedirectResult("/abc", true); Action a = () => result.Should().BeRedirectResult() .WithPermanent(false); a.ShouldThrow<Exception>() .WithMessage("Expected RedirectResult.Permanent to be False but was True"); }
public void WithUrl_GivenUnexpectedUrl_ShouldFail() { ActionResult result = new RedirectResult("/abc"); Action a = () => result.Should().BeRedirectResult() .WithUrl("/xyz"); a.ShouldThrow<Exception>() .WithMessage("Expected RedirectResult.Url to be \"/xyz\" but was \"/abc\""); }
public void BePartialView_GivenNotPartial_ShouldFail() { ActionResult result = new RedirectResult("/"); Action a = () => result.Should().BePartialViewResult(); a.ShouldThrow<Exception>() .WithMessage("Expected ActionResult to be \"PartialViewResult\", but found \"RedirectResult\""); }
public void BeRedirect_GivenRedirect_ShouldPass() { ActionResult result = new RedirectResult("/"); result.Should().BeRedirectResult(); }