public IActionResult GetStations([FromQuery] QueryParameters query) { if (!ModelState.IsValid) { return(BadRequest()); } return(Ok(_stationFinderService.CalculateValuesForDeviceToStation(new Point(query.X, query.Y)))); }
public void TestFindSuitableStation(double x, double y, double expectedPower) { _logger.LogInformation("Starting test"); var res = _stationFinderService.CalculateValuesForDeviceToStation(new Point(x, y)); var suitableStation = res.OrderByDescending(ds => ds.Power).FirstOrDefault(); Assert.Equal(expectedPower, suitableStation.Power); _logger.LogInformation("Successfull"); }