public void HistoryPresenterModel_ResetBindings_Test()
        {
            // Arrange
            Assert.AreEqual(1, _model.QueryBindingSource.Count);

            var parameters = new QueryParameters {
                Name = "Test"
            };

            parameters.Fields.Add(new QueryField {
                Value = 6606
            });
            _model.AddQuery(parameters);
            Assert.AreEqual(2, _model.QueryBindingSource.Count);

            _database.Expect(x => x.Page(1, 1, null, BonusCalculationType.DownloadTime)).IgnoreArguments().Return(new PetaPoco.Page <HistoryEntry>());
            // Act
            _model.ResetBindings(true);
            // Assert
            _database.VerifyAllExpectations();
        }
Ejemplo n.º 2
0
        public void HistoryPresenter_DeleteWorkUnitClick_Test()
        {
            // Arrange
            _model.HistoryBindingSource.Add(new HistoryEntry {
                ID = 1
            });

            _messageBoxView.Expect(x => x.AskYesNoQuestion(null, String.Empty, String.Empty)).IgnoreArguments().Return(DialogResult.Yes);
            _database.Expect(x => x.Delete(null)).IgnoreArguments().Return(1);
            // Act
            _presenter = CreatePresenter();
            _presenter.DeleteWorkUnitClick();
            // Assert
            _messageBoxView.VerifyAllExpectations();
            _database.VerifyAllExpectations();
        }