From f6a38e63401a85ccb3d038a6a50825ddcaf84298 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Tue, 1 Dec 2020 15:12:55 +0100 Subject: Add tests for GetUuid --- tests/Jellyfin.Dlna.Tests/GetUuidTests.cs | 17 +++++++++++ .../Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj | 33 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 tests/Jellyfin.Dlna.Tests/GetUuidTests.cs create mode 100644 tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj (limited to 'tests') diff --git a/tests/Jellyfin.Dlna.Tests/GetUuidTests.cs b/tests/Jellyfin.Dlna.Tests/GetUuidTests.cs new file mode 100644 index 0000000000..7655e3f7ce --- /dev/null +++ b/tests/Jellyfin.Dlna.Tests/GetUuidTests.cs @@ -0,0 +1,17 @@ +using Emby.Dlna.PlayTo; +using Xunit; + +namespace Jellyfin.Dlna.Tests +{ + public static class GetUuidTests + { + [Theory] + [InlineData("uuid:fc4ec57e-b051-11db-88f8-0060085db3f6::urn:schemas-upnp-org:device:WANDevice:1", "fc4ec57e-b051-11db-88f8-0060085db3f6")] + [InlineData("uuid:IGD{8c80f73f-4ba0-45fa-835d-042505d052be}000000000000", "8c80f73f-4ba0-45fa-835d-042505d052be")] + [InlineData("uuid:IGD{8c80f73f-4ba0-45fa-835d-042505d052be}000000000000::urn:schemas-upnp-org:device:InternetGatewayDevice:1", "8c80f73f-4ba0-45fa-835d-042505d052be")] + [InlineData("uuid:00000000-0000-0000-0000-000000000000::upnp:rootdevice", "00000000-0000-0000-0000-000000000000")] + [InlineData("uuid:fc4ec57e-b051-11db-88f8-0060085db3f6", "fc4ec57e-b051-11db-88f8-0060085db3f6")] + public static void GetUuid_Valid_Success(string usn, string uuid) + => Assert.Equal(uuid, PlayToManager.GetUuid(usn)); + } +} diff --git a/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj b/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj new file mode 100644 index 0000000000..f91db6744a --- /dev/null +++ b/tests/Jellyfin.Dlna.Tests/Jellyfin.Dlna.Tests.csproj @@ -0,0 +1,33 @@ + + + + net5.0 + false + true + enable + + + + + + + + + + + + + + + + + + + + + + + ../jellyfin-tests.ruleset + + + -- cgit v1.2.3