-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPositiveDecimalEntityTests.cs
More file actions
21 lines (18 loc) · 1.01 KB
/
PositiveDecimalEntityTests.cs
File metadata and controls
21 lines (18 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using StrongTypes.Api.Entities;
using StrongTypes.Api.IntegrationTests.Infrastructure;
using Xunit;
namespace StrongTypes.Api.IntegrationTests.Tests;
// Values are constrained to two decimal places so they round-trip exactly
// through EF Core's default SQL Server decimal(18,2) mapping.
[Collection(IntegrationTestCollection.Name)]
public sealed class PositiveDecimalEntityTests(TestWebApplicationFactory factory)
: EntityTests<PositiveDecimalEntityTests, PositiveDecimalEntity, Positive<decimal>, Positive<decimal>?, decimal>(factory),
IEntityTestData<decimal>
{
protected override string RoutePrefix => "positive-decimal-entities";
protected override Positive<decimal> Create(decimal raw) => Positive<decimal>.Create(raw);
protected override decimal FirstValid => 5m;
protected override decimal UpdatedValid => 100m;
public static TheoryData<decimal> ValidInputs => new() { 5m, 42m, 10m, 1m, 1.5m, 0.01m };
public static TheoryData<decimal> InvalidInputs => new() { 0m, -1m, -100m, -1.5m };
}