Exemple #1
0
        public void RefrigeratorTestTwo()
        {
            Refrigerator refrigerator = new Refrigerator();
            Tomato       tomato       = new Tomato();
            Cabbage      cabbage      = new Cabbage();
            LadyFinger   ladyFinger   = new LadyFinger();

            refrigerator.AddVegetable(tomato, 25);
            refrigerator.SetVegetableMinimumQuantity(tomato, 10);
            refrigerator.AddVegetable(cabbage, 10);
            refrigerator.SetVegetableMinimumQuantity(cabbage, 2);
            refrigerator.AddVegetable(ladyFinger, 7);
            refrigerator.SetVegetableMinimumQuantity(ladyFinger, 2);

            refrigerator.TakeOutVegetable(tomato, 20);
            refrigerator.TakeOutVegetable(cabbage, 7);

            var actualVegetableQuantity = refrigerator.CheckRefrigeratorContents();

            var expectedVegetableQuantity = new List <KeyValuePair <Vegetable, int> >();

            expectedVegetableQuantity.Add(new KeyValuePair <Vegetable, int>(tomato, 5));
            expectedVegetableQuantity.Add(new KeyValuePair <Vegetable, int>(cabbage, 3));
            expectedVegetableQuantity.Add(new KeyValuePair <Vegetable, int>(ladyFinger, 7));

            Assert.Equal(expectedVegetableQuantity, actualVegetableQuantity);
        }