コード例 #1
0
 public void OkClickedErrorTest()
 {
     // Arrange
     _messageBoxView.Expect(x => x.ShowError(_settingsView, String.Empty, String.Empty)).IgnoreArguments();
     // Act
     _presenter = CreatePresenter();
     _presenter.SettingsModel = new LegacyClientSettingsModel();
     _presenter.OkClicked();
     // Assert
     _messageBoxView.VerifyAllExpectations();
 }
コード例 #2
0
        public void HistoryPresenter_NewQueryClick_Failed_Test()
        {
            // Arrange
            var queryView = MockRepository.GenerateMock <IQueryView>();

            queryView.Expect(x => x.ShowDialog(_view)).Return(DialogResult.OK).Repeat.Once();
            queryView.Stub(x => x.Query).Return(new QueryParameters());
            _viewFactory.Expect(x => x.GetQueryDialog()).Return(queryView);
            _messageBoxView.Expect(x => x.ShowError(_view, String.Empty, String.Empty)).IgnoreArguments();
            // Act
            _presenter = CreatePresenter();
            _presenter.NewQueryClick();
            // Assert
            queryView.VerifyAllExpectations();
            _viewFactory.VerifyAllExpectations();
            _messageBoxView.VerifyAllExpectations();
        }