Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
 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();
 }
Ejemplo n.º 5
0
 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();
 }
Ejemplo n.º 6
0
 public void NewQueryClickCancelTest()
 {
     // Arrange
      _queryView.Expect(x => x.ShowDialog(_view)).Return(DialogResult.Cancel);
      // Act
      _presenter = CreatePresenter();
      _presenter.NewQueryClick();
      // Assert
      _queryView.VerifyAllExpectations();
 }
Ejemplo n.º 7
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();
 }
Ejemplo n.º 8
0
 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();
 }
Ejemplo n.º 9
0
 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();
 }