public void TestAllAreas() { var controller = new AreaController(new RiskAntwerpRest_dbContext()); var actionResult = controller.GetAllAreas(); actionResult.Should().BeOfType <OkObjectResult>(); }
public string[] Get(bool strings) { List <Area> areas = areaController.GetAllAreas(); List <string> areaNames = new List <string>(); foreach (Area area in areas) { areaNames.Add(area.name); } return(areaNames.ToArray()); }
public IActionResult Get(int id) { List <Area> allAreas = areaController.GetAllAreas(); List <string> allNames = new List <string>(); foreach (Area area in allAreas) { allNames.Add(area.name); } return(Ok(new TestObject { name = string.Join(",", allNames.ToArray()), age = 2 })); }