Пример #1
0
        public void InjectingIntoConstructors()
        {
            var dollar            = new Dollar();
            var epayment          = new ElectronicPayment(1.50m);
            var firstTransaction  = new Transaction(dollar);
            var secondTransaction = new Transaction(epayment);

            Console.WriteLine(firstTransaction.GetTransactionType());
            Console.WriteLine(secondTransaction.GetTransactionType());
            Assert.AreEqual("Dollar", firstTransaction.GetTransactionType());
            Assert.AreEqual(1.50m, secondTransaction.GetTransactionAmount());
        }
Пример #2
0
        public void DollarTest()
        {
            ICurrency dollar = new Dollar();

            Assert.AreEqual(1m, dollar.Value);
        }