public void GetAllShouldReturnAllAnimalsFromCollection() { var db = new InMemoryZooDb(); var service = new AnimalsService(db); var allAnmals = service.GetAll().ToList(); Assert.Equal(30, allAnmals.Count); }
public void GetAll_ShouldReturnAllAnimalsFromDatabase_WhickAreNotDeleted() { // Arrange var mockedEfRepository = new Mock <IEfRepository <Animal> >(); var mockedUnitOfWork = new Mock <ISaveContext>(); mockedEfRepository.Setup(x => x.All); var animalsService = new AnimalsService(mockedEfRepository.Object, mockedUnitOfWork.Object); // Act var result = animalsService.GetAll(); // Assert mockedEfRepository.Verify(x => x.All, Times.Once); }