Example #1
0
        public void ProcessInputPrice_WithValidPath_ReturnList()
        {
            var jsonPriceProcessor = new JsonPriceProcessor(new BeverageFactory(), new JsonPriceLoader(@"..\..\..\Data\prices.json"));

            var result = jsonPriceProcessor.ProcessInputPrice();

            Assert.That(result, Is.Not.Null);
        }
Example #2
0
        public void Setup()
        {
            IPriceProcessor   myJsonPriceProcessor   = new JsonPriceProcessor(new BeverageFactory(), new JsonPriceLoader(@"..\..\..\Data\prices.json"));
            IOrderProcessor   myJsonOrderProcessor   = new JsonOrderProcessor(new JsonOrderLoader(@"..\..\..\Data\orders.json"));
            IPaymentProcessor myJsonPaymentProcessor = new JsonPaymentProcessor(new JsonPaymentLoader(@"..\..\..\Data\payments.json"));

            myCafeShop = new CafeShop(myJsonOrderProcessor, myJsonPaymentProcessor);

            List <Coffee> coffeeList = myJsonPriceProcessor.ProcessInputPrice();

            myCafeShop.InitializeCoffeeSelection(coffeeList);
            myCafeShop.LoadOrders();
            myCafeShop.UpdateCustomersBalance();
        }
Example #3
0
        public static void Main(string[] args)
        {
            IPriceProcessor   myJsonPriceProcessor   = new JsonPriceProcessor(new BeverageFactory(), new JsonPriceLoader());
            IOrderProcessor   myJsonOrderProcessor   = new JsonOrderProcessor(new JsonOrderLoader());
            IPaymentProcessor myJsonPaymentProcessor = new JsonPaymentProcessor(new JsonPaymentLoader());
            IResultProvider   myJsonSerializer       = new ResultProvider();

            ICafeShop myCafeShop = new CafeShop(myJsonOrderProcessor, myJsonPaymentProcessor);

            List <Coffee> coffeeList = myJsonPriceProcessor.ProcessInputPrice();

            myCafeShop.InitializeCoffeeSelection(coffeeList);
            myCafeShop.LoadOrders();
            myCafeShop.UpdateCustomersBalance();

            myJsonSerializer.Create(myCafeShop.GetCustomerList());
        }