Exemple #1
0
        public void Should_calculate_total_price(decimal singleItemPrice, int vat, int count, decimal expectedVatAmount)
        {
            var sut   = new CalculatedItemWithVatDtoFactory();
            var model = new CalculatePostModel
            {
                SingleItemPrice = singleItemPrice,
                Key             = "key",
                Amount          = count
            };

            var result = sut.Create(model, vat);

            Assert.AreEqual(expectedVatAmount, result.TotalPriceWithVat);
        }
Exemple #2
0
        public void Should_map_request_data(int vat)
        {
            var sut   = new CalculatedItemWithVatDtoFactory();
            var model = new CalculatePostModel
            {
                SingleItemPrice = 1,
                Key             = "key",
                Amount          = 2
            };

            var result = sut.Create(model, vat);

            Assert.AreEqual(result.VatRate, vat);
            Assert.AreEqual(result.Amount, model.Amount);
            Assert.AreEqual(result.SingleItemPrice, model.SingleItemPrice);
        }