public void SetUp()
 {
     TransactionContainer.AddAction action =
         new TransactionContainer.AddAction(SillyAddAction);
     container   = new TransactionContainer(action);
     transaction = new MockTransaction();
 }
Esempio n. 2
0
 public void SetUp()
 {
     view      = new MockAddEmployeeView();
     container = new TransactionContainer(null);
     database  = new InMemoryPayrollDatabase();
     presenter = new AddEmployeePresenter(
         view, container, database);
 }
Esempio n. 3
0
 public AddEmployeePresenter(AddEmployeeView view,
                             TransactionContainer container,
                             IPayrollDatabase database)
 {
     this.view = view;
     this.transactionContainer = container;
     this.database             = database;
 }
Esempio n. 4
0
 public PayrollPresenter(IPayrollDatabase database,
                         ViewLoader viewLoader)
 {
     this.view       = view;
     this.database   = database;
     this.viewLoader = viewLoader;
     TransactionContainer.AddAction addAction =
         new TransactionContainer.AddAction(TransactionAdded);
     transactionContainer = new TransactionContainer(addAction);
 }
Esempio n. 5
0
        public void SetUp()
        {
            window = new AddEmployeeWindow();
            transactionContainer = new TransactionContainer(null);
            presenter            = new AddEmployeePresenter(
                window, transactionContainer, null);

            window.Presenter = presenter;
            window.Show();
        }
 public PayrollPresenter(PayrollDatabase database,
                         ViewLoader viewLoader)
 {
     View            = View;
     Database        = database;
     this.viewLoader = viewLoader;
     TransactionContainer.AddAction addAction =
         TransactionAdded;
     TransactionContainer = new TransactionContainer(addAction);
 }
Esempio n. 7
0
        public void LoadAddEmployeeView(
            TransactionContainer transactionContainer)
        {
            AddEmployeeWindow    view      = new AddEmployeeWindow();
            AddEmployeePresenter presenter =
                new AddEmployeePresenter(view,
                                         transactionContainer, database);

            view.Presenter = presenter;

            LoadView(view);
        }
        public virtual void RunTransactions()
        {
            foreach (Transaction transaction in
                     TransactionContainer.Transactions)
            {
                transaction.Execute();
            }

            TransactionContainer.Clear();
            UpdateTransactionsTextBox();
            UpdateEmployeesTextBox();
        }
Esempio n. 9
0
        public void AddAction()
        {
            TransactionContainer container =
                presenter.TransactionContainer;
            Transaction transaction = new MockTransaction();

            container.Add(transaction);

            string expected = transaction.ToString()
                              + Environment.NewLine;

            Assert.AreEqual(expected, view.transactionsText);
        }