Esempio n. 1
0
        static void Main(string[] args)
        {
TOP:
            Console.Clear();
            var orderEnum = GetOrderneedToBeproccessed();

            if (orderEnum.HasValue)
            {
                Console.WriteLine();
                Console.WriteLine();
                IRuleCommandFacotry rcf = new RuleCommandFacotry();
                OrderProcessor      op  = new OrderProcessor(orderEnum.Value, rcf, true);
                op.RunCommands();

                Console.WriteLine();
                Console.WriteLine("Press C to Continue processing order.");
                var temp = Console.ReadLine();
                if (temp.ToLower().Equals("c"))
                {
                    goto TOP;
                }
            }
            else
            {
                Console.WriteLine("Invalid orderEnum value, press R to try again");
                var temp = Console.ReadLine();
                if (temp.ToLower().Equals("r"))
                {
                    goto TOP;
                }
            }
        }
        public void Test_RuleCommandsFactory(RuleCommandEnum ruleEnum)
        {
            // Prepare
            var rcf = new RuleCommandFacotry();

            // Run
            var rc = rcf.GetRuleCommands(ruleEnum);

            // Assert
            Assert.IsNotNull(rcf);
            Assert.IsNotNull(rc);
            Assert.IsInstanceOfType(rcf, typeof(IRuleCommandFacotry));
            Assert.IsInstanceOfType(rc, typeof(IRuleCommand));
        }