admin: add common-code crud and business-day rules
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
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, 20)]
|
||||
[InlineData(2026, 9, 24, 2026, 9, 29)]
|
||||
[InlineData(2026, 10, 3, 2026, 10, 8)]
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -18,5 +18,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TaxBaik.Application\TaxBaik.Application.csproj" />
|
||||
<ProjectReference Include="..\TaxBaik.Web\TaxBaik.Web.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user