61114ea31b
Creates the 9-project .NET 8 solution (5 src + 4 test) with Marathon.Domain fully implemented: value objects (SportCode, EventId, OddsRate, OddsValue, BetScope hierarchy), enums (Side, BetType, OddsSource, AnomalyKind), and entities (Sport, Country, League, Event, Bet, OddsSnapshot, EventResult, Anomaly) with all invariants enforced in constructors. 96 domain tests pass (FluentAssertions + xUnit). Directory.Build.props and Directory.Packages.props centralise build settings and NuGet versions. Both Marathon.sln and Marathon.slnx are committed; dotnet build Marathon.sln succeeds with 0 warnings/errors.
49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
using FluentAssertions;
|
|
using Marathon.Domain.ValueObjects;
|
|
|
|
namespace Marathon.Domain.Tests.ValueObjects;
|
|
|
|
public sealed class EventIdTests
|
|
{
|
|
[Fact]
|
|
public void Constructor_CreatesInstance_WhenValueIsNonEmpty()
|
|
{
|
|
var id = new EventId("26456117");
|
|
id.Value.Should().Be("26456117");
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("")]
|
|
[InlineData(" ")]
|
|
[InlineData("\t")]
|
|
public void Constructor_ThrowsArgumentException_WhenValueIsEmptyOrWhitespace(string value)
|
|
{
|
|
var act = () => new EventId(value);
|
|
act.Should().Throw<ArgumentException>()
|
|
.WithParameterName("value");
|
|
}
|
|
|
|
[Fact]
|
|
public void Constructor_ThrowsArgumentException_WhenValueIsNull()
|
|
{
|
|
var act = () => new EventId(null!);
|
|
act.Should().Throw<ArgumentException>()
|
|
.WithParameterName("value");
|
|
}
|
|
|
|
[Fact]
|
|
public void ToString_ReturnsValue()
|
|
{
|
|
var id = new EventId("12345");
|
|
id.ToString().Should().Be("12345");
|
|
}
|
|
|
|
[Fact]
|
|
public void Equality_IsValueBased()
|
|
{
|
|
var a = new EventId("26456117");
|
|
var b = new EventId("26456117");
|
|
a.Should().Be(b);
|
|
}
|
|
}
|