Пример #1
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);
        }
Пример #2
0
        public void RunTransactions()
        {
            MockTransaction transaction = new MockTransaction();

            presenter.TransactionContainer.Add(transaction);
            Employee employee = new Employee(123, "John", "123 Baker St.");

            database.AddEmployee(employee);

            presenter.RunTransactions();

            Assert.IsTrue(transaction.wasExecuted);
            Assert.AreEqual("", view.transactionsText);
            string expectedEmployeeTest = employee.ToString() + Environment.NewLine;

            Assert.AreEqual(expectedEmployeeTest, view.employeesText);
        }