Beispiel #1
0
        static void AbstractFactoryPatternTest()
        {
            CreditCardFactory abstractFactory = CreditCardFactory.GetCreditCardFactory(600);
            CreditCard        creditCard      = abstractFactory.GetCreditCard(CardType.GOLD);

            Console.WriteLine(creditCard.GetType());

            abstractFactory = CreditCardFactory.GetCreditCardFactory(700);
            creditCard      = abstractFactory.GetCreditCard(CardType.PLATINUM);
            Console.WriteLine(creditCard.GetType());
        }
        public void TestVersion05()
        {
            CreditCardFactory abstractFactory = CreditCardFactory.GetCreditCardFactory(775);

            CreditCard card = abstractFactory.GetCreditCard(CardType.PLATINUM);

            Debug.WriteLine(card.GetType());

            abstractFactory = CreditCardFactory.GetCreditCardFactory(600);

            CreditCard card2 = abstractFactory.GetCreditCard(CardType.GOLD);

            Debug.WriteLine(card2.GetType());
        }