Esempio n. 1
0
 public Checkout(Country country, Catalog catalog, TaxEngine taxEngine)
 {
     _country         = country;
     _taxEngine       = taxEngine;
     _catalog         = catalog;
     _currentPurchase = new Purchase(_country);
 }
Esempio n. 2
0
        public void BasicTaxAndImportDutyForImportedNonBasicTaxExemptArticles(Category category)
        {
            var article   = new Article(1, Country.Ita, category, Guid.NewGuid().ToString(), 100);
            var taxEngine = new TaxEngine();
            var tax       = taxEngine.TaxFor(article, Country.Usa);

            Assert.Equal(new BasicTaxAndImportDuty().ApplyTo(article.Price), tax.ApplyTo(article.Price));
        }
Esempio n. 3
0
        public void BasicTaxForLocalNonBasicTaxExemptArticles(Category category)
        {
            var article   = new Article(1, Country.Ita, category, Guid.NewGuid().ToString(), 100);
            var taxEngine = new TaxEngine();
            var tax       = taxEngine.TaxFor(article, article.SupplierCountry);

            Assert.Equal(new BasicTax().ApplyTo(article.Price), tax.ApplyTo(article.Price));
        }