diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-04-21 10:18:29 +0100 |
|---|---|---|
| committer | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-04-21 10:18:29 +0100 |
| commit | 53e1b302cc08181c7909719df0cd837fd4b182f4 (patch) | |
| tree | 35f251cdcf036db107facc45557283947c3a548b /tests | |
| parent | 39eb5da44f8e931aa6a89f9bb3d0785ca5e84465 (diff) | |
Changes as requested
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Jellyfin.Dlna.Tests/DlnaManagerTests.cs (renamed from tests/Jellyfin.Dlna.Tests/ProfileTester.cs) | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/tests/Jellyfin.Dlna.Tests/ProfileTester.cs b/tests/Jellyfin.Dlna.Tests/DlnaManagerTests.cs index 004933ca9..087d43a77 100644 --- a/tests/Jellyfin.Dlna.Tests/ProfileTester.cs +++ b/tests/Jellyfin.Dlna.Tests/DlnaManagerTests.cs @@ -46,7 +46,7 @@ namespace Jellyfin.Dlna.Tests ModelDescription = "LG WebOSTV DMRplus", ModelName = "LG TV", ModelNumber = "1.0", - Identification = new DeviceIdentification() + Identification = new () { FriendlyName = "My Device", Manufacturer = "LG Electronics", @@ -69,7 +69,8 @@ namespace Jellyfin.Dlna.Tests } }; - Assert.True(GetManager().IsMatch(device.ToDeviceIdentification(), profile2.Identification)); + var deviceMatch = GetManager().IsMatch(device.ToDeviceIdentification(), profile2.Identification); + Assert.True(deviceMatch); } [Fact] @@ -90,7 +91,7 @@ namespace Jellyfin.Dlna.Tests ModelDescription = "LG WebOSTV DMRplus", ModelName = "LG TV", ModelNumber = "1.0", - Identification = new DeviceIdentification() + Identification = new () { FriendlyName = "My Device", Manufacturer = "LG Electronics", @@ -101,7 +102,29 @@ namespace Jellyfin.Dlna.Tests } }; - Assert.False(GetManager().IsMatch(device.ToDeviceIdentification(), profile.Identification)); + var deviceMatch = GetManager().IsMatch(device.ToDeviceIdentification(), profile.Identification); + + Assert.False(deviceMatch); + } + + [Fact] + public void IsMatch_GivenNamesAndRegExMatch_ReturnsTrue() + { + var device = new DeviceInfo() + { + Name = "My Device" + }; + + var profile = new DeviceProfile() + { + Name = "Test Profile", + FriendlyName = "My .*", + Identification = new () + }; + + var deviceMatch = GetManager().IsMatch(device.ToDeviceIdentification(), profile.Identification); + + Assert.True(deviceMatch); } } } |
