コード例 #1
0
 public IActionResult GetStations([FromQuery] QueryParameters query)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest());
     }
     return(Ok(_stationFinderService.CalculateValuesForDeviceToStation(new Point(query.X, query.Y))));
 }
コード例 #2
0
        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");
        }