public void HistoryPresenter_NewQueryClick_Cancel_Test()
        {
            // Arrange
            var queryView = MockRepository.GenerateMock <IQueryView>();

            queryView.Expect(x => x.ShowDialog(_view)).Return(DialogResult.Cancel);
            _viewFactory.Expect(x => x.GetQueryDialog()).Return(queryView);
            // Act
            _presenter = CreatePresenter();
            _presenter.NewQueryClick();
            // Assert
            queryView.VerifyAllExpectations();
            _viewFactory.VerifyAllExpectations();
        }
        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();
        }
        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();
        }
 public void NewQueryClickTest()
 {
     // Arrange
      _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);
      // Act
      _presenter = CreatePresenter();
      _presenter.NewQueryClick();
      // Assert
      _queryView.VerifyAllExpectations();
 }
 public void NewQueryClickFailedTest()
 {
     // Arrange
      _queryView.Expect(x => x.ShowDialog(_view)).Return(DialogResult.OK);
      _queryView.Stub(x => x.Query).Return(new QueryParameters());
      _messageBoxView.Expect(x => x.ShowError(_view, String.Empty, String.Empty)).IgnoreArguments();
      // Act
      _presenter = CreatePresenter();
      _presenter.NewQueryClick();
      // Assert
      _queryView.VerifyAllExpectations();
      _messageBoxView.VerifyAllExpectations();
 }
 public void NewQueryClickCancelTest()
 {
     // Arrange
      _queryView.Expect(x => x.ShowDialog(_view)).Return(DialogResult.Cancel);
      // Act
      _presenter = CreatePresenter();
      _presenter.NewQueryClick();
      // Assert
      _queryView.VerifyAllExpectations();
 }
 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();
 }
 public void HistoryPresenter_NewQueryClick_Cancel_Test()
 {
    // Arrange
    var queryView = MockRepository.GenerateMock<IQueryView>();
    queryView.Expect(x => x.ShowDialog(_view)).Return(DialogResult.Cancel);
    _viewFactory.Expect(x => x.GetQueryDialog()).Return(queryView);
    // Act
    _presenter = CreatePresenter();
    _presenter.NewQueryClick();
    // Assert
    queryView.VerifyAllExpectations();
    _viewFactory.VerifyAllExpectations();
 }
 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();
 }