예제 #1
0
 public void HistoryPresenter_DeleteQueryClick_Failed_Test()
 {
     // Arrange
     _messageBoxView.Expect(x => x.AskYesNoQuestion(_view, String.Empty, String.Empty)).IgnoreArguments().Return(DialogResult.Yes);
     _messageBoxView.Expect(x => x.ShowError(_view, String.Empty, String.Empty)).IgnoreArguments();
     // Act
     _presenter = CreatePresenter();
     _presenter.DeleteQueryClick();
     // Assert
     _messageBoxView.VerifyAllExpectations();
 }
예제 #2
0
 public void DeleteQueryClickFailedTest()
 {
     // Arrange
      _messageBoxView.Expect(x => x.AskYesNoQuestion(_view, String.Empty, String.Empty)).IgnoreArguments().Return(DialogResult.Yes);
      _messageBoxView.Expect(x => x.ShowError(_view, String.Empty, String.Empty)).IgnoreArguments();
      // Act
      _presenter = CreatePresenter();
      _presenter.DeleteQueryClick();
      // Assert
      _messageBoxView.VerifyAllExpectations();
 }
예제 #3
0
        public void HistoryPresenter_DeleteQueryClick_No_Test()
        {
            // Arrange
            var parameters = new QueryParameters {
                Name = "Test"
            };

            parameters.Fields.Add(new QueryField {
                Value = 6606
            });
            _model.AddQuery(parameters);

            _messageBoxView.Expect(x => x.AskYesNoQuestion(_view, String.Empty, String.Empty)).IgnoreArguments().Return(DialogResult.No);
            // Act
            _presenter = CreatePresenter();
            Assert.AreEqual(2, _model.QueryBindingSource.Count);
            _presenter.DeleteQueryClick();
            // Assert
            Assert.AreEqual(2, _model.QueryBindingSource.Count);
            _messageBoxView.VerifyAllExpectations();
        }
예제 #4
0
        public void DeleteQueryClickNoTest()
        {
            // Arrange
             var parameters = new QueryParameters { Name = "Test" };
             parameters.Fields.Add(new QueryField { Value = 6606 });
             _model.AddQuery(parameters);

             _messageBoxView.Expect(x => x.AskYesNoQuestion(_view, String.Empty, String.Empty)).IgnoreArguments().Return(DialogResult.No);
             // Act
             _presenter = CreatePresenter();
             Assert.AreEqual(2, _model.QueryBindingSource.Count);
             _presenter.DeleteQueryClick();
             // Assert
             Assert.AreEqual(2, _model.QueryBindingSource.Count);
             _messageBoxView.VerifyAllExpectations();
        }