public void Yearly_Should_Start_On_New_Years_Day() { //Arrange var factory = new TaxPeriodFactory(); var start = new DateTime(2020, 1, 2); //Act var res = factory.CreateTaxPeriod(start, TaxTypes.Yearly, 1); //Assert res.Start.ShouldBe(new DateTime(2020, 1, 1)); }
[InlineData("2000/12/01", "2000/12/31")] //December public void Monthly_Should_End_On_A_The_Last(string date, string expectedEnd) { //Arrange var factory = new TaxPeriodFactory(); var start = DateTime.Parse(date); //Act var res = factory.CreateTaxPeriod(start, TaxTypes.Monthly, 1); //Assert res.End.ShouldBe(DateTime.Parse(expectedEnd)); }
[InlineData("2020/01/12", "2020/01/19")] //Sunday public void Weekly_Should_End_On_A_Sunday(string start, string expectedEnd) { //Arrange var factory = new TaxPeriodFactory(); var startDate = DateTime.Parse(start); //Act var res = factory.CreateTaxPeriod(startDate, TaxTypes.Weekly, 1); //Assert res.End.ShouldBe(DateTime.Parse(expectedEnd)); }
public void Monthly_Should_Start_On_The_First() { //Arrange var factory = new TaxPeriodFactory(); var start = new DateTime(2020, 1, 2); //Act var res = factory.CreateTaxPeriod(start, TaxTypes.Monthly, 1); //Assert res.Start.ShouldBe(new DateTime(2020, 1, 1)); }
public void Daily_Should_End_Same_Day() { //Arrange var factory = new TaxPeriodFactory(); var start = new DateTime(2019, 1, 2); //Act var res = factory.CreateTaxPeriod(start, TaxTypes.Daily, 1); //Assert res.End.ShouldBe(start); }