protected void DeleteButton_Click(object sender, EventArgs e) { var presenter = new CompanyDetailPresenter(this); presenter.Delete(); Response.Redirect("~/Pages/Companies.aspx"); }
public void Delete_EnsureCalled() { bool methodCalled = false; ICompanyRepository repository = new StubICompanyRepository { DeleteInt32 = x => { methodCalled = true; } }; var presenter = new CompanyDetailPresenter(this.view, repository); presenter.Delete(); Assert.IsTrue(methodCalled); }