public void DeleteTransferCallsControllerRemoveTransferFromBatch() { MockEFTController controller = new MockEFTController(); NewTransferViewPresenter presenter = new NewTransferViewPresenter(controller); MockNewTransferView view = new MockNewTransferView(); Transfer deletedTransfer = GetNewTransfer(); presenter.View = view; presenter.OnTransferDeleted(deletedTransfer); Assert.IsTrue(controller.RemoveTransferFromBatchCalled); Assert.AreSame(deletedTransfer, controller.TransferRemovedFromBatch); }
public void AddIsEnabledAfterFithItemDeleted() { MockEFTController controller = new MockEFTController(); NewTransferViewPresenter presenter = new NewTransferViewPresenter(controller); MockNewTransferView view = new MockNewTransferView(); presenter.View = view; Transfer deletedTransfer = GetNewTransfer(); Assert.IsTrue(view.EnableAddTransfer); presenter.OnTransferInserted(GetNewTransfer()); presenter.OnTransferInserted(GetNewTransfer()); presenter.OnTransferInserted(GetNewTransfer()); presenter.OnTransferInserted(GetNewTransfer()); presenter.OnTransferInserted(deletedTransfer); presenter.OnViewLoaded(); Assert.IsFalse(view.EnableAddTransfer); presenter.OnTransferDeleted(deletedTransfer); presenter.OnViewLoaded(); Assert.IsTrue(view.EnableAddTransfer); }
public void AddIsEnabledAfterFithItemDeleted() { MockEFTController controller = new MockEFTController(); NewTransferViewPresenter presenter = new NewTransferViewPresenter(controller); MockNewTransferView view = new MockNewTransferView(); presenter.View = view; Transfer deletedTransfer = GetNewTransfer(); Assert.IsTrue(view.EnableAddTransfer); presenter.OnTransferInserted(GetNewTransfer()); presenter.OnTransferInserted(GetNewTransfer()); presenter.OnTransferInserted(GetNewTransfer()); presenter.OnTransferInserted(GetNewTransfer()); presenter.OnTransferInserted(deletedTransfer); presenter.OnViewLoaded(); Assert.IsFalse(view.EnableAddTransfer); presenter.OnTransferDeleted(deletedTransfer); presenter.OnViewLoaded(); Assert.IsTrue(view.EnableAddTransfer); }
public void DeleteTransferCallsControllerRemoveTransferFromBatch() { MockEFTController controller = new MockEFTController(); NewTransferViewPresenter presenter = new NewTransferViewPresenter(controller); MockNewTransferView view = new MockNewTransferView(); Transfer deletedTransfer = GetNewTransfer(); presenter.View = view; presenter.OnTransferDeleted(deletedTransfer); Assert.IsTrue(controller.RemoveTransferFromBatchCalled); Assert.AreSame(deletedTransfer, controller.TransferRemovedFromBatch); }
protected void TransferBatchDataSource_Deleted(object sender, ObjectContainerDataSourceStatusEventArgs e) { _presenter.OnTransferDeleted((Transfer)e.Instance); }