public void Defaults_To_Text_View() { IDBMergeResultProcessor results = MockRepository.GenerateStub <IDBMergeResultProcessor>(); results.Stub(r => r.GetTextResults()).Return("results"); IDetailedDBMergeResultForm form = MockRepository.GenerateMock <IDetailedDBMergeResultForm>(); var presenter = new DetailedDBMergeResultPresenter(form, results); presenter.Show(); form.AssertWasCalled(f => f.TextResults = "results"); }
public void Attaches_To_The_GetHtmlResults_Event_Listener_And_Performs_That_Action() { IDBMergeResultProcessor results = MockRepository.GenerateStub <IDBMergeResultProcessor>(); results.Stub(r => r.GetHtmlResults()).Return("results"); IDetailedDBMergeResultForm form = MockRepository.GenerateMock <IDetailedDBMergeResultForm>(); new DetailedDBMergeResultPresenter(form, results); form.Raise(f => f.GetHtmlResults += null, form, null); // raise the GetTextResults event form.AssertWasCalled(f => f.GetHtmlResults += null, c => c.IgnoreArguments()); form.AssertWasCalled(f => f.HtmlResults = "results"); }