public void HistoryPresenter_NewQueryClick_Test() { // Arrange var queryView = MockRepository.GenerateMock <IQueryView>(); queryView.Expect(x => x.ShowDialog(_view)).Return(DialogResult.OK); var parameters = new QueryParameters { Name = "Test" }; parameters.Fields.Add(new QueryField { Value = 6606 }); queryView.Stub(x => x.Query).Return(parameters); _viewFactory.Expect(x => x.GetQueryDialog()).Return(queryView); // Act _presenter = CreatePresenter(); _presenter.NewQueryClick(); // Assert queryView.VerifyAllExpectations(); _viewFactory.VerifyAllExpectations(); }