public void GetAllCentreSummariesForMap_calls_dataService_and_returns_all_summary_details() { // Given var centres = Builder <CentreSummaryForMap> .CreateListOfSize(10).Build(); A.CallTo(() => centresDataService.GetAllCentreSummariesForMap()).Returns(centres); // When var result = centresService.GetAllCentreSummariesForMap(); // Then result.Should().BeEquivalentTo(centres); }
public void CentreData_returns_expected_json_result() { // Given var centres = Builder <CentreSummaryForMap> .CreateListOfSize(10).Build(); A.CallTo(() => centresService.GetAllCentreSummariesForMap()).Returns(centres); // When var result = controller.CentreData(); // Then using (new AssertionScope()) { result.Should().BeJsonResult(); result.As <JsonResult>().Value.Should().BeEquivalentTo(centres); } }
public IActionResult CentreData() { var centres = centresService.GetAllCentreSummariesForMap(); return(Json(centres)); }