public async void GetAllLocations_ShouldReadFromDbContext() { // Arrange SetUp(); var locationsInDb = new List <Location> { new Location { Id = 1 }, new Location { Id = 2 }, new Location { Id = 3 } }; _context.Locations.Returns(locationsInDb); // Act var sit = new LocationDataService(_factory); var results = (await sit.GetAllLocationsAsync()).ToList(); // Assert Assert.Equal(locationsInDb[0].Id, results[0].Id); Assert.Equal(locationsInDb[1].Id, results[1].Id); Assert.Equal(locationsInDb[2].Id, results[2].Id); }