Ejemplo n.º 1
0
        private void GetMaterialOrderItemProcessingStrategyTest()
        {
            var expected = typeof(MaterialOrderItemProcessingStrategy);

            var orderItem = _builderUtils.BuildOrderItem(1, "Cheese Burger", 5.5f, 1, OrderItemType.Material);

            var target = BuildTestTarget();

            var result = target.GetOrderItemProcessingStrategy(orderItem);

            Assert.Equal(expected, result.GetType());
        }
Ejemplo n.º 2
0
        public void BasicMaterialOrderItemGetOrderTotalTest()
        {
            var orderItem = _builderUtils.BuildOrderItem(1, "Cheese Burger", 5.5f, 1, OrderItemType.Material);

            var location = _builderUtils.BuildLocation();

            var target = BuildTestTarget();

            var result = target.GetOrderItemTotal(orderItem, location);

            // 5.5 + .474375 = 5.974375
            var expected = 5.974375f;

            Assert.Equal(expected, result);
        }
        public void BasicServiceOrderItemGetOrderTotalTest()
        {
            var orderItem = _builderUtils.BuildOrderItem(1, "Delivery Service", 5.5f, 1, OrderItemType.Service);

            var location = _builderUtils.BuildLocation();

            var target = BuildTestTarget();

            var result = target.GetOrderItemTotal(orderItem, location);

            // 5.5 * 1 = 5.5
            var expected = 5.5f;

            Assert.Equal(expected, result);
        }
Ejemplo n.º 4
0
 private Order BuildOrder()
 {
     return(new Order
            (
                new List <OrderItem>
     {
         _builderUtils.BuildOrderItem(1, "Cheese Burger", 10.5f, 1, OrderItemType.Material)
     }
            ));
 }