admin/src/Oms.Tests/KpiAreaSnapshotMapperTests.cs
zzh 7827b4803e feat: slim rules/price publish snapshots with PostcodeRange (left,right]
Use slim DTOs without audit timestamps; migrate legacy LeftPostcode/RightPostcode on read.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 14:10:34 +08:00

24 lines
740 B
C#

using FluentAssertions;
using Oms.Application.Shared;
namespace Oms.Tests;
public class KpiAreaSnapshotMapperTests
{
[Theory]
[InlineData("06000", "(00000,50000]", true)]
[InlineData("00000", "(00000,50000]", false)]
[InlineData("50000", "(00000,50000]", true)]
[InlineData("50001", "(00000,50000]", false)]
public void IsZipInLeftOpenRightClosedRange_ShouldMatchExpected(string zip, string range, bool expected)
{
KpiAreaSnapshotMapper.IsZipInLeftOpenRightClosedRange(zip, range).Should().Be(expected);
}
[Fact]
public void BuildPostcodeRange_ShouldFormatLeftOpenRightClosed()
{
KpiAreaSnapshotMapper.BuildPostcodeRange("00000", "50000").Should().Be("(00000,50000]");
}
}