public CalculateTaxOverTheBuyAndSellStacks ( |
||
buyStack | ||
sellStack | ||
return |
public void ShouldBeAbleToCalculateTaxGivenABuyStackAndSellStackWithMultipleValues() { Instrument share = new Stock(new Symbol("REL"), new Price(10.00), "Rel*iance Power"); Transaction buyTransaction1 = new BuyTransaction(new DateTime(2008, 06, 01), share, 20, new Price(10.00), 5.00, 3.00); Transaction sellTransaction1 = new SellTransaction(new DateTime(2009, 01, 01), share, 10, new Price(20.00), 5.00, 3.00); Transaction buyTransaction2 = new BuyTransaction(new DateTime(2008, 12, 01), share, 10, new Price(10.00), 5.00, 3.00); Transaction sellTransaction2 = new SellTransaction(new DateTime(2009, 08, 01), share, 10, new Price(20.00), 5.00, 3.00); List<Transaction> listTransaction = new List<Transaction> { buyTransaction1, sellTransaction1, buyTransaction2, sellTransaction2 }; ShortTermTaxCalculator TaxCalculator = new ShortTermTaxCalculator(listTransaction, new FinYear(2009)); Stack buyStack = TaxCalculator.CreateBuyTransactionStack(); Stack sellStack = TaxCalculator.CreateSellTransactionStack(); Assert.AreEqual(2, buyStack.Count); Assert.AreEqual(2, sellStack.Count); Price Tax; Tax = TaxCalculator.CalculateTaxOverTheBuyAndSellStacks(buyStack, sellStack); // Assert.AreEqual(0, buyStack.Count); // Assert.AreEqual(0, sellStack.Count); Assert.AreEqual(20, Tax.Value); }