Example #1
0
 public void Setup()
 {
     items = new List <Item>()
     {
         new Item {
             Name = "A", Price = 50
         },
         new Item {
             Name = "B", Price = 30
         },
         new Item {
             Name = "C", Price = 60
         },
         new Item {
             Name = "D", Price = 15
         }
     };
     shoppedTtems = new List <ShoppedItem>()
     {
         new ShoppedItem {
             Name = "A", Count = 1
         },
         new ShoppedItem {
             Name = "B", Count = 1
         },
         new ShoppedItem {
             Name = "C", Count = 1
         },
         new ShoppedItem {
             Name = "D", Count = 1
         }
     };
     checkoutKata = new CheckoutKata(items, rules, shoppedTtems);
 }
Example #2
0
 public void Setup()
 {
     rules = new List <Rule>()
     {
         new Rule {
             ItemName = "A", Count = 3, Price = 120
         },
         new Rule {
             ItemName = "B", Count = 2, Price = 45
         }
     };
     checkoutKata = new CheckoutKata(items, rules, shoppedTtems);
 }
Example #3
0
        //1. Checkout returns a value -> X
        //2. basket stores items -> X
        //3. can remove item from basket -> X
        //4. cant remove item out of bounds -> X
        //5. basket can calculate price on checkout (Without rules) -> X
        //6. Can calculate basket with rules where all items are the same
        //7. basket can calculate price on checkout with pricing rules
        //8. basket can calculate price on checkout with pricing rules but more items than rules allow for i.e rule says 3 for 120 and you put 4 in

        public UnitTest1()
        {
            helper = new CheckoutKata();
        }