public async Task GetNeighbourhoodByCityNameShouldReturnNeighbourhoodOrNull(string name, int expectedResult) { var service = new NeighbourhoodServices(context); var neighbourhoods = await service.GetNeighbourhoodsByCityAsync(name); var actualResult = neighbourhoods == null ? 0 : neighbourhoods.AsQueryable().Count(); Assert.That(actualResult == expectedResult, NeighbourhoodCountMismatchMessage); }
public async Task GetNeighbourhoodByNameShouldReturnNeighbourhoodIfValidNameProvidedOrNullIfInvalidName(string name, string expectedResult) { var service = new NeighbourhoodServices(context); var neighbourhood = await service.GetNeighbourhoodByNameAsync(name); var actualResult = neighbourhood == null ? null : neighbourhood.Name; Assert.That(actualResult == expectedResult, NeighbourhoodNameMismatchMessage); }