Exemplo n.º 1
0
        public async Task Given_InvalidCarsToPurchase_Should_ThrowException()
        {
            var cars = _fixture.CreateMany <Repository.Cars.Car>(3).ToList();

            cars[0].Id = 1;
            cars[1].Id = 2;
            cars[2].Id = 3;

            _carRepositoryCache.GetAllCars().Returns(cars);

            // Act.
            Assert.ThrowsAsync <HttpResponseException>(async() => await _sut.CalculateDiscount(new List <int> {
                1, 2, 3, 4
            }));
        }
Exemplo n.º 2
0
 public Task <IDiscountCalculatorResponse> Post(List <int> carIdsToPurchase)
 {
     return(_purchasePriceCalculatorService.CalculateDiscount(carIdsToPurchase));
 }