Exemple #1
0
        private static Store.PizzaStore CallStore(SupportedStoreEnum storeToUse, string order)
        {
            Console.WriteLine("Calling Store....");
            switch (storeToUse)
            {
            case SupportedStoreEnum.NewYork:
                return(new NewYorkPizzaStore());

            case SupportedStoreEnum.Chicago:
                return(new ChicagoPizzaStore());

            case SupportedStoreEnum.Traditional:
                return(new TraditionalStore());

            default:
                throw new NotSupportedException();
            }
        }
 public static bool IsValidAnswer(this SupportedStoreEnum answer)
 {
     return(answer != SupportedStoreEnum.UnKnown);
 }