Use TheoryData in UrlDecodeQueryFeatureTest

pull/6546/head
ianjazz246 3 years ago
parent 00f7f68e53
commit c5393b2579

@ -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 [MemberData(nameof(EmptyValueTest_TestData))]
[InlineData("random+test", "random test")] // encoded
[InlineData("random%20test", "random test")] // encoded
[InlineData("++", " ")] // encoded
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>

Loading…
Cancel
Save