Send service info on WebSocket connect
This commit is contained in:
@@ -74,6 +74,20 @@ public sealed class SyncMessageTests
|
||||
Assert.AreEqual(8181, root.GetProperty("port").GetInt32());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void WebSocketServiceInfoContainsDeviceName()
|
||||
{
|
||||
using var server = new WebSocketServerService(new SyncMessageHandler(new RecordingKeyboardInjectionService()), "Desktop-WIN11");
|
||||
|
||||
using var document = JsonDocument.Parse(server.BuildServiceInfoJson());
|
||||
var root = document.RootElement;
|
||||
|
||||
Assert.AreEqual("wirelessTextSyncer.service", root.GetProperty("type").GetString());
|
||||
Assert.AreEqual(1, root.GetProperty("version").GetInt32());
|
||||
Assert.AreEqual("Desktop-WIN11", root.GetProperty("name").GetString());
|
||||
Assert.AreEqual(8181, root.GetProperty("port").GetInt32());
|
||||
}
|
||||
|
||||
private sealed class RecordingKeyboardInjectionService : IKeyboardInjectionService
|
||||
{
|
||||
public List<string> Calls { get; } = [];
|
||||
|
||||
Reference in New Issue
Block a user