public void GetPoiList_NoPoiFound_ReturnObjectNotFound() { //Arrange var city = CityPoiItemBuilder.GenerateCity(); city.PointsOfInterest = null; FakeCityRepository.GetPointsOfInterestForCity(city.Id).Returns(city.PointsOfInterest); //Action var result = PoiController.GetPointsOfInterestForCity(city.Id); // Assert result.Should().BeOfType <NotFoundResult>(); }
public void GetPOIList_CityExist_ReturnPOIList() { //Arrange var city = CityPoiItemBuilder.GenerateCity(); FakeCityRepository.GetPointsOfInterestForCity(city.Id).Returns(city.PointsOfInterest); FakeCityRepository.CityExists(city.Id).Returns(true); var poiDto = new PointsOfInterestDto { PoiList = city.PointsOfInterest }; //Action var result = PoiController.GetPointsOfInterestForCity(city.Id); // Assert result.Should().BeOfType <ObjectResult>().Which.Value.ShouldBeEquivalentTo(poiDto); }