feat: consolidate legacy parity migration baseline
This commit is contained in:
@@ -29,13 +29,27 @@ public sealed class LegacyBridgeProtocolTests
|
||||
public void ParsePointer_RequiresExactBoundedInput()
|
||||
{
|
||||
const string json =
|
||||
"{\"type\":\"cut-pointer-down\",\"payload\":{\"physicalIndex\":1,\"control\":false,\"shift\":true,\"x\":20,\"y\":45,\"timestampMilliseconds\":1400}}";
|
||||
"{\"type\":\"cut-pointer-down\",\"payload\":{\"physicalIndex\":1,\"control\":false,\"shift\":true,\"x\":20,\"y\":45,\"timestampMilliseconds\":1400,\"allowAppend\":false}}";
|
||||
|
||||
Assert.True(LegacyBridgeProtocol.TryParseIntent(json, out var parsed, out _));
|
||||
var pointer = Assert.IsType<LegacyCutPointerDownIntent>(parsed);
|
||||
Assert.Equal(1, pointer.PhysicalIndex);
|
||||
Assert.True(pointer.Shift);
|
||||
Assert.Equal(1_400, pointer.TimestampMilliseconds);
|
||||
Assert.False(pointer.AllowAppend);
|
||||
|
||||
Assert.False(LegacyBridgeProtocol.TryParseIntent(
|
||||
"{\"type\":\"cut-pointer-down\",\"payload\":{\"physicalIndex\":1,\"control\":false,\"shift\":true,\"x\":20,\"y\":45,\"timestampMilliseconds\":1400}}",
|
||||
out _,
|
||||
out _));
|
||||
Assert.False(LegacyBridgeProtocol.TryParseIntent(
|
||||
"{\"type\":\"cut-pointer-down\",\"payload\":{\"physicalIndex\":1,\"control\":false,\"shift\":true,\"x\":20,\"y\":45,\"timestampMilliseconds\":1400,\"allowAppend\":0}}",
|
||||
out _,
|
||||
out _));
|
||||
Assert.False(LegacyBridgeProtocol.TryParseIntent(
|
||||
"{\"type\":\"cut-pointer-down\",\"payload\":{\"physicalIndex\":1,\"control\":false,\"shift\":true,\"x\":20,\"y\":45,\"timestampMilliseconds\":1400,\"allowAppend\":true,\"sceneCode\":\"5001\"}}",
|
||||
out _,
|
||||
out _));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -48,7 +62,8 @@ public sealed class LegacyBridgeProtocolTests
|
||||
var json =
|
||||
"{\"type\":\"cut-pointer-down\",\"payload\":{" +
|
||||
$"\"physicalIndex\":{physicalIndex},\"control\":false," +
|
||||
"\"shift\":false,\"x\":0,\"y\":0,\"timestampMilliseconds\":0}}";
|
||||
"\"shift\":false,\"x\":0,\"y\":0,\"timestampMilliseconds\":0," +
|
||||
"\"allowAppend\":true}}";
|
||||
|
||||
Assert.Equal(expected, LegacyBridgeProtocol.TryParseIntent(
|
||||
json,
|
||||
|
||||
Reference in New Issue
Block a user