public void KonstantTaxStrategyConstructorTest() { // Arrange TaxConfiguration configuration = new TaxConfiguration { Kanton = Kanton.Bern, Betragsart = Betragsart.Rente, Tarif = 0.1m, Strategieart = Strategieart.Konstant }; // Act KonstantTaxStrategy strategy = new KonstantTaxStrategy(configuration); // Assert Assert.AreSame(configuration, strategy.Configuration); }
public void TranchenTaxStrategyConstructorTest() { // Arrange TaxConfiguration configuration = new TaxConfiguration { Betragsart = Betragsart.Rente, Kanton = Kanton.Bern, Strategieart = Strategieart.Tranchen, Tarif = 0m }; // Act TranchenTaxStrategy strategy = new TranchenTaxStrategy(configuration); // Assert Assert.AreSame(configuration, strategy.Configuration); }
public void CalculateTest() { // Arrange TaxConfiguration configuration = new TaxConfiguration { Kanton = Kanton.Bern, Betragsart = Betragsart.Rente, Tarif = 0.1m, Strategieart = Strategieart.Konstant }; KonstantTaxStrategy strategy = new KonstantTaxStrategy(configuration); decimal betrag = 100m; decimal expected = 10m; // Act decimal actual = strategy.Calculate(betrag); // Assert Assert.AreEqual(expected, actual); }
public void CalculateTest() { // Arrange TaxConfiguration configuration = new TaxConfiguration { Betragsart = Betragsart.Rente, Kanton = Kanton.Bern, Strategieart = Strategieart.Tranchen, Tarif = 0, Tranchen = new List<TaxTranche> { new TaxTranche { BetragVon = 0, BetragBis = 50, Tarif = 0.05m }, new TaxTranche { BetragVon = 50, Tarif = 0.1m } } }; TranchenTaxStrategy strategy = new TranchenTaxStrategy(configuration); decimal betrag = 100; decimal expected = 7.5m; // Act decimal actual = strategy.Calculate(betrag); // Assert Assert.AreEqual(expected, actual); }
public KonstantTaxStrategy(TaxConfiguration configuration) : base(configuration) { }
public void SaveAndUpdateTaxConfiguration(TaxConfiguration configuration) { throw new NotImplementedException(); }
public void RemoveTaxConfiguration(TaxConfiguration configuration) { throw new NotImplementedException(); }
public TaxStrategyBase(TaxConfiguration configuration) { this.Configuration = configuration; }