21 lines
699 B
C#
21 lines
699 B
C#
using System.Text.Json;
|
|
using Ludarium.Domain;
|
|
|
|
namespace Ludarium.UnitTests;
|
|
|
|
public sealed class SnapshotSerializationTests
|
|
{
|
|
[Fact]
|
|
public void PersistedSnapshotRoundTripsThroughJson()
|
|
{
|
|
var expected = new IntegritySnapshot(Guid.NewGuid(), "baseline", "6", "0.3.1", DateTimeOffset.UtcNow,
|
|
[new SnapshotItem(Guid.NewGuid(), "roms/nes/example.nes", 16, new string('a', 64), Guid.NewGuid(), null)]);
|
|
|
|
var actual = JsonSerializer.Deserialize<IntegritySnapshot>(JsonSerializer.Serialize(expected));
|
|
|
|
Assert.NotNull(actual);
|
|
Assert.Single(actual.Items);
|
|
Assert.Equal(expected.Items[0].RelativePath, actual.Items[0].RelativePath);
|
|
}
|
|
}
|