public void CityRejectsOverlappingTaxesPerTaxType() { var city = new City("Winnipeg"); var pstTax1 = new Tax("PST", DateTime.Today, DateTime.Today.AddMonths(6)); var pstTax2 = new Tax("PST", DateTime.Today.AddMonths(6), DateTime.Today.AddYears(1)); city.AddTax(pstTax1); city.AddTax(pstTax2); }
public void CityRejectsDuplicateTaxes() { var city = new City("Winnipeg"); var pstTax1 = new Tax("PST", DateTime.Today, DateTime.Today.AddMonths(6)); var pstTax2 = new Tax("PST", DateTime.Today, DateTime.Today.AddMonths(6)); city.AddTax(pstTax1); city.AddTax(pstTax2); }
public void CityCanAccumulateTaxes() { var city = new City("Winnipeg"); var pstTax = new Tax("PST", DateTime.Today, DateTime.Today.AddMonths(6)); city.AddTax(pstTax); Assert.IsTrue(city.Taxes.Contains(pstTax)); }
public void CityDelegatesAddedTaxesToInjectedTaxesService() { // expectations var pstTax = new Tax("PST", DateTime.Today, DateTime.Today.AddMonths(6), JurisdictionEnum.City); _mockTaxesService.AddTax(pstTax); _mockRepository.ReplayAll(); var city = new City("Winnipeg", _mockTaxesService); city.AddTax(pstTax); }
public void TaxesServiceDistinguishesCorrectlyEachJurisdiction() { var taxesService = new TaxesService(); var city = new City("CityTax", taxesService); var cityTax = new Tax("CityTax", DateTime.Today, DateTime.Today.AddMonths(6), JurisdictionEnum.City); city.AddTax(cityTax); var provinceState = new City("ProvStateTax", taxesService); var provStateTax = new Tax("ProvStateTax", DateTime.Today, DateTime.Today.AddMonths(6), JurisdictionEnum.ProvinceState); provinceState.AddTax(provStateTax); var country = new City("CountryTax", taxesService); var countryTax = new Tax("CountryTax", DateTime.Today, DateTime.Today.AddMonths(6), JurisdictionEnum.Country); country.AddTax(countryTax); Assert.AreEqual(1, city.Taxes.Count); Assert.AreEqual(1, provinceState.Taxes.Count); Assert.AreEqual(1, country.Taxes.Count); }
public void Setup() { _mockRepository = new MockRepository(); _mockTaxesService = _mockRepository.Stub<ITaxesService>(); _city = new City("CityTax", _mockTaxesService); var cityTax = new Tax("CityTax", DateTime.Today, DateTime.Today.AddMonths(6), JurisdictionEnum.City, 2); _mockTaxesService.Taxes.Add(cityTax); _provinceState = new ProvinceState("ProvStateTax", _mockTaxesService); var provStateTax = new Tax("ProvStateTax", DateTime.Today, DateTime.Today.AddMonths(6), JurisdictionEnum.ProvinceState, 3); _mockTaxesService.Taxes.Add(provStateTax); _country = new Country("CountryTax", _mockTaxesService); var countryTax = new Tax("CountryTax", DateTime.Today, DateTime.Today.AddMonths(6), JurisdictionEnum.Country, 4); _mockTaxesService.Taxes.Add(countryTax); }