public void AddMoreUnitsForTheSameSku()
        {
            var checkout = new Checkout();

            checkout.AddUnit(_testSkuId, _testNumberOfUnits);
            checkout.AddUnit(_testSkuId, _testNumberOfUnits);

            var firstUnit = checkout.Units.Single();

            Assert.Equal(_testSkuId, firstUnit.SkuId);
            Assert.Equal(_testNumberOfUnits * 2, firstUnit.NumberOfUnits);
        }
        public async Task <int> AddUnits(Checkout checkout, int skuId, int numberOfUnits = 1)
        {
            Guard.Against.NegativeOrZero(numberOfUnits, nameof(numberOfUnits));
            var totalUnits = checkout.AddUnit(skuId, numberOfUnits);
            await _checkoutRepository.UpdateAsync(checkout);

            return(totalUnits);
        }
        public void AddNewUnit()
        {
            var checkout = new Checkout();
            int numberOfUnitsReturned = checkout.AddUnit(_testSkuId, _testNumberOfUnits);

            var firstUnit = checkout.Units.Single();

            Assert.Equal(_testSkuId, firstUnit.SkuId);
            Assert.Equal(_testNumberOfUnits, firstUnit.NumberOfUnits);
            Assert.Equal(_testNumberOfUnits, numberOfUnitsReturned);
        }