Esempio n. 1
0
        public static void Main()
        {
            CreditCard One   = CreateCreditCard.NewCard("Visa", 100);
            CreditCard Two   = CreateCreditCard.NewCard("Mastercard", 100);
            CreditCard Three = CreateCreditCard.NewCard("Discover", 100);

            CreditCard[] TestOneCards = { One, Two, Three };
            Wallet       Wallet1      = CreateNewWallet.CreateWallet("Wallet", TestOneCards);

            Wallet[] WalArray = { Wallet1 };
            Person   Bob      = CreateNewPerson.CreatePerson("Bob", WalArray);

            Console.WriteLine(Bob.GetInterest());
            Console.ReadLine();
        }
Esempio n. 2
0
        public void TestOne()
        {
            CreditCard One   = CreateCreditCard.NewCard("Visa", 100);
            CreditCard Two   = CreateCreditCard.NewCard("Mastercard", 100);
            CreditCard Three = CreateCreditCard.NewCard("Discover", 100);

            CreditCard[] TestOneCards = { One, Two, Three };
            Wallet       Wallet1      = CreateNewWallet.CreateWallet("Wallet", TestOneCards);

            Wallet[] WalArray = { Wallet1 };
            Person   Bob      = CreateNewPerson.CreatePerson("Bob", WalArray);

            Assert.Equal(One.GetInterest(), 100m * .1m);
            Assert.Equal(Two.GetInterest(), 100m * .05m);
            Assert.Equal(Three.GetInterest(), 100m * .01m);
            Assert.Equal(Bob.GetInterest(), 16m);
        }
Esempio n. 3
0
        public void TestTwo()
        {
            CreditCard One   = CreateCreditCard.NewCard("Visa", 100);
            CreditCard Two   = CreateCreditCard.NewCard("Discover", 100);
            CreditCard Three = CreateCreditCard.NewCard("Mastercard", 100);

            CreditCard[] Wal1    = { One, Two };
            CreditCard[] Wal2    = { Three };
            Wallet       Wallet1 = CreateNewWallet.CreateWallet("Wallet1", Wal1);
            Wallet       Wallet2 = CreateNewWallet.CreateWallet("Wallet2", Wal2);

            Wallet[] WalArray = { Wallet1, Wallet2 };
            Person   Tim      = CreateNewPerson.CreatePerson("Tim", WalArray);

            Assert.Equal(Tim.GetInterest(), 16m);
            Assert.Equal(Wallet1.GetInterest(), (100m * .1m) + (100m * .01m));
            Assert.Equal(Wallet2.GetInterest(), 100m * .05m);
        }
Esempio n. 4
0
        public void TestThree()
        {
            CreditCard One = CreateCreditCard.NewCard("Visa", 100);
            CreditCard Two = CreateCreditCard.NewCard("Mastercard", 100);

            CreditCard[] Wal1    = { One, Two };
            CreditCard[] Wal2    = { One, Two };
            Wallet       Wallet1 = CreateNewWallet.CreateWallet("Wallet1", Wal1);
            Wallet       Wallet2 = CreateNewWallet.CreateWallet("Wallet2", Wal2);

            Wallet[] WalArray1 = { Wallet1 };
            Wallet[] WalArray2 = { Wallet2 };
            Person   Fred      = CreateNewPerson.CreatePerson("Fred", WalArray1);
            Person   Dave      = CreateNewPerson.CreatePerson("Dave", WalArray2);

            Assert.Equal(Fred.GetInterest(), (100m * .1m) + (100m * .05m));
            Assert.Equal(Wallet1.GetInterest(), (100m * .1m) + (100m * .05m));
            Assert.Equal(Dave.GetInterest(), (100m * .1m) + (100m * .05m));
            Assert.Equal(Wallet2.GetInterest(), (100m * .1m) + (100m * .05m));
        }