Browse Source

Use TheoryData in UrlDecodeQueryFeatureTest

ianjazz246 3 years ago
parent
commit
c5393b2579
1 changed files with 11 additions and 4 deletions
  1. 11 4
      tests/Jellyfin.Server.Tests/UrlDecodeQueryFeatureTests.cs

+ 11 - 4
tests/Jellyfin.Server.Tests/UrlDecodeQueryFeatureTests.cs

@@ -10,11 +10,18 @@ namespace Jellyfin.Server.Tests
 {
 {
     public static class UrlDecodeQueryFeatureTests
     public static class UrlDecodeQueryFeatureTests
     {
     {
+        public static TheoryData<string, string> EmptyValueTest_TestData()
+        {
+            var data = new TheoryData<string, string>();
+            data.Add("e0a72cb2a2c7", "e0a72cb2a2c7"); // isn't encoded
+            data.Add("random+test", "random test"); // encoded
+            data.Add("random%20test", "random test"); // encoded
+            data.Add("++", "  "); // encoded
+            return data;
+        }
+
         [Theory]
         [Theory]
-        [InlineData("e0a72cb2a2c7", "e0a72cb2a2c7")] // isn't encoded
-        [InlineData("random+test", "random test")] // encoded
-        [InlineData("random%20test", "random test")] // encoded
-        [InlineData("++", "  ")] // encoded
+        [MemberData(nameof(EmptyValueTest_TestData))]
         public static void EmptyValueTest(string query, string key)
         public static void EmptyValueTest(string query, string key)
         {
         {
             var dict = new Dictionary<string, StringValues>
             var dict = new Dictionary<string, StringValues>