aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2021-02-12 18:35:54 +0100
committerBond_009 <bond.009@outlook.com>2021-02-12 18:35:54 +0100
commite1bc322b709756529759fbb74cb003e133f30ab6 (patch)
tree5d0498a8f3720db7eee3af7d593490bbbb9a6698 /tests
parent3a9fcb6abd249759bd44b2fbcf437beee8f611c2 (diff)
Add test for WriteGetMessage
Diffstat (limited to 'tests')
-rw-r--r--tests/Jellyfin.Server.Implementations.Tests/LiveTv/HdHomerunManagerTests.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/LiveTv/HdHomerunManagerTests.cs b/tests/Jellyfin.Server.Implementations.Tests/LiveTv/HdHomerunManagerTests.cs
index 15cc12d64..7e04a1ec1 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/LiveTv/HdHomerunManagerTests.cs
+++ b/tests/Jellyfin.Server.Implementations.Tests/LiveTv/HdHomerunManagerTests.cs
@@ -35,5 +35,24 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv
Assert.Equal(expected.Length, len);
Assert.True(expected.SequenceEqual(buffer.Slice(0, len)));
}
+
+ [Fact]
+ public void WriteGetMessage_Valid_Success()
+ {
+ ReadOnlySpan<byte> expected = stackalloc byte[]
+ {
+ 0, 4,
+ 0, 12,
+ 3,
+ 10, (byte)'/', (byte)'t', (byte)'u', (byte)'n', (byte)'e', (byte)'r', (byte)'0', (byte)'/', (byte)'N', 0,
+ 0xc0, 0xc9, 0x87, 0x33
+ };
+
+ Span<byte> buffer = stackalloc byte[128];
+ int len = HdHomerunManager.WriteGetMessage(buffer, 0, "N");
+
+ Assert.Equal(expected.Length, len);
+ Assert.True(expected.SequenceEqual(buffer.Slice(0, len)));
+ }
}
}