Skip to content

Commit 9bb81fa

Browse files
committed
Added test
1 parent 7c49c91 commit 9bb81fa

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/ImageSharp.Web.Tests/Commands/PresetOnlyQueryCollectionRequestParserTests.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,28 @@ public void PresetOnlyQueryCollectionRequestParserExtractsCommands()
3333
Assert.Equal(expected, actual);
3434
}
3535

36+
[Fact]
37+
public void PresetOnlyQueryCollectionRequestParserExtractsCommandsWithOtherCasing()
38+
{
39+
IDictionary<string, string> expected = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
40+
{
41+
{ "width", "400" },
42+
{ "height", "200" }
43+
};
44+
45+
HttpContext context = CreateHttpContext("?PRESET=PRESET1");
46+
IDictionary<string, string> actual = new PresetOnlyQueryCollectionRequestParser(Options.Create(new PresetOnlyQueryCollectionRequestParserOptions
47+
{
48+
Presets = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
49+
{
50+
{ "Preset1", "width=400&height=200" }
51+
}
52+
})).ParseRequestCommands(context);
53+
54+
Assert.Equal(expected, actual);
55+
}
56+
57+
3658
[Fact]
3759
public void PresetOnlyQueryCollectionRequestParserCommandsWithoutPresetParam()
3860
{

0 commit comments

Comments
 (0)