Ejemplo n.º 1
0
        public void AddToSodaInventory_ShouldWork()
        {
            MockDataAccess   da    = new MockDataAccess();
            SodaMachineLogic logic = new SodaMachineLogic(da);

            List <SodaModel> sodas = new List <SodaModel>
            {
                new SodaModel {
                    Name = "Coke", SlotOccupied = "1"
                },
                new SodaModel {
                    Name = "Coke", SlotOccupied = "1"
                }
            };

            logic.AddSodaToInventory(sodas);


            int expected = 7;
            int actual   = da.SodaInventory.Where(x => x.Name == "Coke").Count();

            Assert.Equal(expected, actual);
        }