public void GetAllEmployeeFromRepository()
 {
     // Arrange
     Sale sale1 = GetItemName(1, "Pen", "Pen", 10, null);
     Sale sale2 = GetItemName(2, "Pencil", "Pencil", 10, null);
     InmemoryItemRepository itemrepository = new InmemoryItemRepository();
     itemrepository.Add(sale1);
     itemrepository.Add(sale2);
     var controller = GetItemController(itemrepository);
     var result = controller.Index();
     var datamodel = (IEnumerable<Sale>)result.ViewData.Model;
     CollectionAssert.Contains(datamodel.ToList(), sale1);
     CollectionAssert.Contains(datamodel.ToList(), sale2);
 }
Ejemplo n.º 2
0
        public void GetAllEmployeeFromRepository()
        {
            // Arrange
            Item item1 = GetItemName(1, "Chair", "Chair", 550, null);
            Item item2 = GetItemName(2, "Table", "Table", 1050, null);
            InmemoryItemRepository itemrepository = new InmemoryItemRepository();

            itemrepository.Add(item1);
            itemrepository.Add(item2);
            var controller = GetItemController(itemrepository);
            var result     = controller.Index();
            var datamodel  = (IEnumerable <Item>)result.ViewData.Model;

            CollectionAssert.Contains(datamodel.ToList(), item1);
            CollectionAssert.Contains(datamodel.ToList(), item2);
        }