public void PlaceOrder_CustomerValid_GetsTaxInfo()
        {
            // Arrange
            StubProductRepository(true, SkuConstString);
            StubGetStandardCustomerFromRepository();

            var orderConfirmation = new OrderConfirmation
            {
                CustomerId = CustomerIdConstInt
            };

            StubFulfillOrder(orderConfirmation);

            var taxList = new List <TaxEntry>
            {
                new TaxEntry
                {
                    Description = "First entry.",
                    Rate        = 2.3m
                },
                new TaxEntry()
                {
                    Description = "Second entry.",
                    Rate        = 0.098m
                }
            };

            StubTaxRateService(taxList);

            // Act
            var orderSummary = _orderService.PlaceOrder(_order);

            // Assert
            _mockTaxRateService.AssertWasCalled(t => t.GetTaxEntries(PostalCodeConstString, CountryConstString));
            Assert.That(orderSummary.Taxes, Is.EqualTo(taxList));
        }
示例#2
0
 public void Test_TaxRateService_Was_Called_Once()
 {
     _order = CreateOrderObject(product_sku_1, product_sku_2);
     _orderService.PlaceOrder(_order);
     _taxRateService.AssertWasCalled(s => s.GetTaxEntries(postalCode, country), options => options.Repeat.Times(1));
 }