ASP.NET MVC Controller Unit Testing - Problem with UrlHelper Extension
问题 Trying to do some controller unit-testing in my ASP.NET MVC 3 web application. My test goes like this: [TestMethod] public void Ensure_CreateReviewHttpPostAction_RedirectsAppropriately() { // Arrange. var newReview = CreateMockReview(); // Act. var result = _controller.Create(newReview) as RedirectResult; // Assert. Assert.IsNotNull(result, "RedirectResult was not returned"); } Pretty simple. Basically testing a [HttpPost] action to ensure it returns a RedirectResult (PRG pattern). I'm not