public void AddIsDisabledAfterFiveItemsAdded()
        {
            MockEFTController controller = new MockEFTController();
            NewTransferViewPresenter presenter = new NewTransferViewPresenter(controller);
            MockNewTransferView view = new MockNewTransferView();
            presenter.View = view;

            Assert.IsTrue(view.EnableAddTransfer);

            presenter.OnTransferInserted(GetNewTransfer());
            presenter.OnTransferInserted(GetNewTransfer());
            presenter.OnTransferInserted(GetNewTransfer());
            presenter.OnTransferInserted(GetNewTransfer());
            presenter.OnTransferInserted(GetNewTransfer());

            presenter.OnViewLoaded();
            Assert.IsFalse(view.EnableAddTransfer);
        }
Beispiel #2
0
        public void AddIsDisabledAfterFiveItemsAdded()
        {
            MockEFTController        controller = new MockEFTController();
            NewTransferViewPresenter presenter  = new NewTransferViewPresenter(controller);
            MockNewTransferView      view       = new MockNewTransferView();

            presenter.View = view;

            Assert.IsTrue(view.EnableAddTransfer);

            presenter.OnTransferInserted(GetNewTransfer());
            presenter.OnTransferInserted(GetNewTransfer());
            presenter.OnTransferInserted(GetNewTransfer());
            presenter.OnTransferInserted(GetNewTransfer());
            presenter.OnTransferInserted(GetNewTransfer());

            presenter.OnViewLoaded();
            Assert.IsFalse(view.EnableAddTransfer);
        }
Beispiel #3
0
        public void InsertTransferCallsControllerAddTransferToBatch()
        {
            MockEFTController        controller = new MockEFTController();
            NewTransferViewPresenter presenter  = new NewTransferViewPresenter(controller);
            MockNewTransferView      view       = new MockNewTransferView();
            Transfer insertedTransfer           = GetNewTransfer();

            presenter.View = view;

            presenter.OnTransferInserted(insertedTransfer);

            Assert.IsTrue(controller.AddTransferToBatchCalled);
            Assert.AreSame(insertedTransfer, controller.TransferAddedToBatch);
        }
        public void InsertTransferCallsControllerAddTransferToBatch()
        {
            MockEFTController controller = new MockEFTController();
            NewTransferViewPresenter presenter = new NewTransferViewPresenter(controller);
            MockNewTransferView view = new MockNewTransferView();
            Transfer insertedTransfer = GetNewTransfer();
            presenter.View = view;

            presenter.OnTransferInserted(insertedTransfer);

            Assert.IsTrue(controller.AddTransferToBatchCalled);
            Assert.AreSame(insertedTransfer, controller.TransferAddedToBatch);
        }
 protected void TransferBatchDataSource_Inserted(object sender, ObjectContainerDataSourceStatusEventArgs e)
 {
     _presenter.OnTransferInserted((Transfer)e.Instance);
 }