Files
taxbaik/TaxBaik.Application.Tests/BusinessDayCalculatorTests.cs
T
kjh2064 c8cf654131
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m8s
Expand business day coverage
2026-07-02 17:11:09 +09:00

37 lines
1.2 KiB
C#

namespace TaxBaik.Application.Tests;
using TaxBaik.Web.Components.Admin.Shared;
using Xunit;
public class BusinessDayCalculatorTests
{
[Theory]
[InlineData(2026, 2, 14, 2026, 2, 19)]
[InlineData(2026, 8, 15, 2026, 8, 18)]
[InlineData(2026, 10, 3, 2026, 10, 6)]
[InlineData(2026, 9, 24, 2026, 9, 28)]
[InlineData(2027, 2, 6, 2027, 2, 10)]
[InlineData(2027, 10, 9, 2027, 10, 12)]
public void GetEffectiveDueDate_SkipsWeekendHolidayAndSubstituteHoliday(
int dueYear, int dueMonth, int dueDay,
int expectedYear, int expectedMonth, int expectedDay)
{
var effective = BusinessDayCalculator.GetEffectiveDueDate(new DateOnly(dueYear, dueMonth, dueDay));
Assert.Equal(new DateOnly(expectedYear, expectedMonth, expectedDay), effective);
}
[Theory]
[InlineData(2026, 2, 19, 0)]
[InlineData(2026, 2, 20, -1)]
[InlineData(2026, 2, 18, 1)]
public void GetDday_UsesEffectiveDueDate(
int refYear, int refMonth, int refDay,
int expectedDays)
{
var dday = BusinessDayCalculator.GetDday(new DateOnly(2026, 2, 14), new DateOnly(refYear, refMonth, refDay));
Assert.Equal(expectedDays, dday);
}
}