public async Task ReturnsSpotPrice()
            {
                var request  = _requests;
                var response = await _svc.GetSmartSpotPricesAsync(request);

                response.Should().NotBeNull();
                response.Should().HaveCount(2);
                response[0].LoadId.Should().Be(request[0].LoadId);
                response[0].Price.Should().Be(EXPECTED_GUARD_RATE_0);
                response[0].DATGuardRate.Should().Be(EXPECTED_GUARD_RATE_0);
                response[0].MachineLearningRate.Should().Be(EXPECTED_SPOT_PRICE_0);
                response[1].LoadId.Should().Be(request[1].LoadId);
                response[1].Price.Should().Be(EXPECTED_SPOT_PRICE_1);
                response[1].DATGuardRate.Should().Be(EXPECTED_GUARD_RATE_1);
                response[1].MachineLearningRate.Should().Be(EXPECTED_SPOT_PRICE_1);
            }
예제 #2
0
        public async Task <IActionResult> PostAsync([FromBody] List <LoadshopSmartSpotPriceRequest> requests)
        {
            var prices = await _svc.GetSmartSpotPricesAsync(requests);

            return(Success(prices));
        }