fix: support Visual Studio 2026 package loading
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Xunit;
|
||||
|
||||
namespace Prophet.CoopWithDsh.Tests
|
||||
@@ -19,5 +20,32 @@ namespace Prophet.CoopWithDsh.Tests
|
||||
Assert.True(snapshot.Documents[0].Dirty);
|
||||
Assert.Equal("2026-01-01T00:00:00.0000000Z", snapshot.UpdatedAt);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PublisherWritesProtocolV1WithoutExternalJsonRuntime()
|
||||
{
|
||||
var root = Path.Combine(Path.GetTempPath(), "coop-with-dsh-test-" + Guid.NewGuid().ToString("N"));
|
||||
try
|
||||
{
|
||||
using (var publisher = new SnapshotPublisher(root))
|
||||
{
|
||||
var snapshot = SnapshotModel.Create(publisher.InstanceId, 42, null, new[] {
|
||||
new OpenDocument { Path = "F:\\Project\\main.cs", Label = "main.cs", Dirty = true },
|
||||
}, new DateTimeOffset(2026, 1, 1, 0, 0, 0, TimeSpan.Zero));
|
||||
publisher.Publish(snapshot);
|
||||
var json = File.ReadAllText(publisher.FilePath);
|
||||
|
||||
Assert.Contains("\"version\":1", json);
|
||||
Assert.Contains("\"ide\":\"visualstudio\"", json);
|
||||
Assert.Contains("\"documents\":[{", json);
|
||||
Assert.Contains("\"dirty\":true", json);
|
||||
Assert.DoesNotContain("\"workspace\"", json);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (Directory.Exists(root)) Directory.Delete(root, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user