33 lines
856 B
C#
33 lines
856 B
C#
using FluentAssertions;
|
|
using FreeCode.Core.Enums;
|
|
using FreeCode.Services;
|
|
using Xunit;
|
|
|
|
namespace FreeCode.Tests.Unit.Services;
|
|
|
|
public sealed class CompanionServiceTests
|
|
{
|
|
private readonly CompanionService _sut = new();
|
|
|
|
[Fact]
|
|
public void Create_ReturnsValidCompanionWithAllFields()
|
|
{
|
|
var companion = _sut.Create("seed-1");
|
|
|
|
Enum.IsDefined(companion.Species).Should().BeTrue();
|
|
Enum.IsDefined(companion.Eye).Should().BeTrue();
|
|
Enum.IsDefined(companion.Hat).Should().BeTrue();
|
|
Enum.IsDefined(companion.Rarity).Should().BeTrue();
|
|
companion.Name.Should().NotBeNullOrWhiteSpace();
|
|
}
|
|
|
|
[Fact]
|
|
public void Create_WithSameSeed_IsDeterministic()
|
|
{
|
|
var left = _sut.Create("same-seed");
|
|
var right = _sut.Create("same-seed");
|
|
|
|
left.Should().Be(right);
|
|
}
|
|
}
|