示例#1
0
        internal void Run(string[] args)
        {
            IInputReader reader = GetInputReaderBasedOnCommandLineArgs(args);
            Tuple <IEnumerable <ProductSpec>, IEnumerable <CompetitorProduct> > input;

            try
            {
                input = reader.Get();
            }
            catch (Exception ex)
            {
                Console.WriteLine($"The inputs are no in the right format. Details {ex}");


                throw;
            }
            var resultProducts = PricingEngineFactory.Get().DoPricing(input.Item1, input.Item2);

            resultProducts.ForEach(result => Console.WriteLine(result.Price));
        }
示例#2
0
        public void WhenGetIsCalled_ReturnValidIPricingEngine()
        {
            IPricingEngine engine = PricingEngineFactory.Get();

            Assert.IsInstanceOfType(engine, typeof(IPricingEngine), "PricingEngineFactory not working");
        }