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(); }
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(); }
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(); }
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(); }