public void TestCalculateTodayIsThursday() { DateTime nextThursday = DateTime.Now; for (var i = 1; i < 8; i++) { if (nextThursday.DayOfWeek == DayOfWeek.Thursday) { return; } nextThursday = nextThursday.AddDays(i); } Tax tax = new Tax(new ErehwonCitizen { BirthDate = DateTime.Parse("1999-04-30"), FirstName = "Test", LastName = "Person" }, nextThursday); //Act decimal taxAmount = tax.Calculate(100); //Assert Assert.AreEqual(16m, taxAmount); }
public void SingleTaxesTest(decimal amount, decimal expectedTaxes) { Tax tax = new Tax(new SingleTax(), TaxSituation.Single); decimal t = tax.Calculate(amount); Assert.True(decimal.Compare(t, expectedTaxes) == 0); }
public void HHTaxesTest(decimal amount, decimal expectedTaxes) { Tax tax = new Tax(new HHTax(), TaxSituation.HeadofHousehold); decimal t = tax.Calculate(amount); Assert.True(decimal.Compare(t, expectedTaxes) == 0); }
public void MFJOrQWTaxTest(decimal amount, decimal expectedTaxes) { Tax tax = new Tax(new MFJOrQWTax(), TaxSituation.MarriedfilingJointlyorQualifyingWidow); decimal t = tax.Calculate(amount); Assert.True(decimal.Compare(t, expectedTaxes) == 0); }
public void MFSTaxTest(decimal amount, decimal expectedTaxes) { Tax tax = new Tax(new MFSTax(), TaxSituation.MarriedFilingSeparately); decimal t = tax.Calculate(amount); Assert.True(decimal.Compare(t, expectedTaxes) == 0); }
public decimal CheckOut() { decimal totalWithoutTax = cart.TotalPrice(); Tax tax = new Tax(); decimal taxAmt = tax.Calculate(totalWithoutTax, this); return(taxAmt + totalWithoutTax); }
public void TestIfThursday() { //arrange Person peep = PersonMaker("Wayne", "Bradey", 33); Tax tax = new Tax(); decimal amountToTax = 10.00m; //act decimal result = tax.Calculate(peep, amountToTax); //assert Assert.AreEqual(0.80m, result); }
public void FirstNameTest() { //arrange Person peep = PersonMaker("james", "Rick", 33); Tax tax = new Tax(); decimal amountToTax = 10.00m; //act decimal result = tax.Calculate(peep, amountToTax); //assert Assert.AreEqual(1.60m, result); }
public void TestCalculate2() { //Arrange Citizen jimmy = new Citizen("James", "Walters", Convert.ToDateTime("01/05/2014")); Tax ErehwonTaxes = new Tax(); decimal price = 1.00m; //Act decimal total = ErehwonTaxes.Calculate(jimmy, price); //Assert Assert.AreEqual(1m, total); }
public void TestCalculate1() { //Arrange Citizen billy = new Citizen("Bill", "McMurray", Convert.ToDateTime("01/05/1990")); Tax ErehwonTaxes = new Tax(); decimal price = 100.00m; //Act decimal total = ErehwonTaxes.Calculate(billy, price); //Assert Assert.AreEqual(108.00m, total); }
public void AgeLessThanFive() { //arrange Person peep = PersonMaker("billy", "bob", 6); Tax tax = new Tax(); decimal amountToTax = 100.00m; //act decimal result = tax.Calculate(peep, amountToTax); //assert Assert.AreEqual(0, result); }
public void TestCalculateAgeLessFive() { //Arrange Tax tax = new Tax(new ErehwonCitizen { BirthDate = DateTime.Parse("2010-06-01"), FirstName = "Test", LastName = "Person" }); //Act decimal taxAmount = tax.Calculate(100); //Assert Assert.AreEqual(0, taxAmount); }
public void TestCalculateTodayIsThursday() { DateTime thursday = DateTime.Now; for (int i = 1; i < 8; i++) { if (thursday.DayOfWeek == DayOfWeek.Tuesday) return; thursday = thursday.AddDays(1); } Tax tax = new Tax(thursday); decimal result = tax.Calculate(100, DateTime.Parse("1998-05-18"), "John", "doe"); Assert.AreEqual(32, result); }
public void TestCalculateTodayIsThursday() { DateTime thursday = DateTime.Now; for (int i = 1; i < 8; i++) { if (thursday.DayOfWeek == DayOfWeek.Tuesday) { return; } thursday = thursday.AddDays(1); } Tax tax = new Tax(thursday); decimal result = tax.Calculate(100, DateTime.Parse("1998-05-18"), "John", "doe"); Assert.AreEqual(32, result); }
public void TestCalculateTodayIsThursday() { DateTime nextThursday = DateTime.Now; for (var i = 1; i < 8; i++) { if (nextThursday.DayOfWeek == DayOfWeek.Thursday) return; nextThursday = nextThursday.AddDays(i); } Tax tax = new Tax(new ErehwonCitizen { BirthDate = DateTime.Parse("1999-04-30"), FirstName = "Test", LastName = "Person" }, nextThursday); //Act decimal taxAmount = tax.Calculate(100); //Assert Assert.AreEqual(16m, taxAmount); }
public decimal IncomeTax() { return(Tax.Calculate(GrossIncome(), Brackets.Table()[workState])); }