Files
dsh-plugin-coop-with-vs/visualstudio-extension/Prophet.CoopWithDsh.Tests/SnapshotModelTests.cs
T

24 lines
875 B
C#
Raw Normal View History

2026-08-17 11:52:48 +08:00
using System;
using Xunit;
namespace Prophet.CoopWithDsh.Tests
{
public sealed class SnapshotModelTests
{
[Fact]
public void CreateDeduplicatesPathsAndPreservesDirtyState()
{
var snapshot = SnapshotModel.Create("one", 10, "F:\\Project\\App.sln", new[] {
new OpenDocument { Path = "F:\\Project\\main.cs", Label = "main.cs", Dirty = false },
new OpenDocument { Path = "f:\\project\\MAIN.cs", Label = "MAIN.cs", Dirty = true },
}, new DateTimeOffset(2026, 1, 1, 0, 0, 0, TimeSpan.Zero));
Assert.Equal(1, snapshot.Version);
Assert.Equal("visualstudio", snapshot.Ide);
Assert.Single(snapshot.Documents);
Assert.True(snapshot.Documents[0].Dirty);
Assert.Equal("2026-01-01T00:00:00.0000000Z", snapshot.UpdatedAt);
}
}
}