David Hayden's experience leads him to believe that Model-View-Presenter Seems Easier to Test Than ASP.NET MVC. He asks for some insight from the inter-web to help him see the light. He uses the following example to highlight the simplicity of testing MVP:
[Test]
public void EmptyCustomerNameShouldCauseInvalidCustomerMessage()
{
MockRepository mocks = new MockRepository();
IAddCustomerView mockView = mocks.CreateMock<IAddCustomerView>();
AddCustomerPresenter presenter = new AddCustomerPresenter(mockView);
Expect.Call(mockView.CustomerName).Return(string.Empty);
Expect.Call(mockView.CustomerTitle).Return("Jester");
Expect.Call(mockView.PhoneNumber).Return("555-1212");
mockView.Message = "Invalid Customer...";
mocks.ReplayAll();
presenter.onAddCustomer();
mocks.VerifyAll();
}
Here is the same unit test using MVC:
[Test]
public void EmptyCustomerNameShouldCauseInvalidCustomerMessage()
{
CustomerController controller = new CustomerController();
controller.Add(string.Empty, "Jester", "555-1212");
Assert.IsTrue(controller.ViewData.Contains("message"));
Assert.AreEqual("Invalid Customer...", controller.ViewData["message"]);
}
I hope this helps contrast the two approaches. I will leave it up to you to decide which is simpler.