public void OneCardHolderOneWalletThreeCardsTest()
        {
            double result;
            double expectedValue;

            Card mc  = new Card("MC", .05, 100);
            Card vs  = new Card("VISA", .10, 100);
            Card dis = new Card("DIS", .01, 100);

            result        = mc.CalculateInterest();
            expectedValue = 5;
            Assert.AreEqual(expectedValue, result);

            result        = vs.CalculateInterest();
            expectedValue = 10;
            Assert.AreEqual(expectedValue, result);

            result        = dis.CalculateInterest();
            expectedValue = 1;
            Assert.AreEqual(expectedValue, result);


            Wallet wallet = new Wallet()
            {
                cards = { mc, vs, dis }
            };
            CardHolder cardHolder = new CardHolder()
            {
                wallets = { wallet }
            };

            result        = cardHolder.CalculateInterest();
            expectedValue = 16;
            Assert.AreEqual(expectedValue, result);
        }
Example #2
0
        static void Main(string[] args)
        {
            Card mc  = new Card("MS", .05, 100);
            Card vs  = new Card("VS", .10, 100);
            Card dis = new Card("DIS", .01, 100);
            Card amx = new Card("AMX", .03, 100);


            Wallet wallet1 = new Wallet()
            {
                cards = { mc, vs, dis }
            };

            Console.WriteLine("The total interest wallet 1 is {0} ", wallet1.CalculateInterest());

            Card mc1  = new Card("MS", .05, 100);
            Card dis1 = new Card("DIS", .01, 100);

            Wallet wallet2 = new Wallet()
            {
                cards = { mc1, dis1 }
            };

            Console.WriteLine("The total interest wallet 2 is {0} ", wallet2.CalculateInterest());


            CardHolder cardHolder1 = new CardHolder()
            {
                wallets = { wallet1, wallet2 }
            };

            Console.WriteLine("The total interest ot mutiplewallets is {0} ", cardHolder1.CalculateInterest());

            CardHolder cardHolder2 = new CardHolder()
            {
                wallets = { wallet2 }
            };
            CardHolder cardHolder3 = new CardHolder()
            {
                wallets = { wallet1 }
            };


            Account account = new Account()
            {
                cardHolders = { cardHolder2, cardHolder3 }
            };

            Console.WriteLine("The total interest ot mutiplewallets is {0} ", account.CalculateInterest());
        }
        public void TwoCardHolderOneWalletEachTest()
        {
            double result;
            double expectedValue;

            Card   mc     = new Card("MC", .05, 100);
            Card   vs     = new Card("VISA", .10, 100);
            Card   dis    = new Card("DIS", .01, 100);
            Wallet wallet = new Wallet()
            {
                cards = { mc, vs, dis }
            };

            CardHolder cardHolder = new CardHolder()
            {
                wallets = { wallet }
            };

            result        = cardHolder.CalculateInterest();
            expectedValue = 16;
            Assert.AreEqual(expectedValue, result);


            Card   mc2     = new Card("MC", .05, 100);
            Card   vs2     = new Card("VISA", .10, 100);
            Wallet wallet2 = new Wallet()
            {
                cards = { mc2, vs2 }
            };
            CardHolder cardHolder2 = new CardHolder()
            {
                wallets = { wallet2 }
            };

            result        = cardHolder2.CalculateInterest();
            expectedValue = 15;
            Assert.AreEqual(expectedValue, result);
        }
        public void OneCardHolderTwoWalletsTest()
        {
            double result;
            double expectedValue;

            Card   vs     = new Card("VISA", .10, 100);
            Card   dis    = new Card("DIS", .01, 100);
            Wallet wallet = new Wallet()
            {
                cards = { vs, dis }
            };

            result        = wallet.CalculateInterest();
            expectedValue = 11;
            Assert.AreEqual(expectedValue, result);

            Card   mc2     = new Card("MC", .05, 100);
            Wallet wallet2 = new Wallet()
            {
                cards = { mc2 }
            };

            result        = wallet2.CalculateInterest();
            expectedValue = 5;
            Assert.AreEqual(expectedValue, result);


            CardHolder cardHolder = new CardHolder()
            {
                wallets = { wallet, wallet2 }
            };

            result        = cardHolder.CalculateInterest();
            expectedValue = 16;
            Assert.AreEqual(expectedValue, result);
        }