|
| 1 | +using System; |
1 | 2 | using System.Collections.Generic; |
2 | 3 | using System.IO; |
3 | 4 | using System.Text; |
@@ -231,6 +232,50 @@ public async Task GetParameterValueReturnsNullIfNoParameterFoundAsync() |
231 | 232 | } |
232 | 233 | } |
233 | 234 |
|
| 235 | + [Fact] |
| 236 | + public void GetParameterValueReturnsCorrectlyWithoutComparisonType() |
| 237 | + { |
| 238 | + using (Stream stream = TestUtil.StringToStream(_testCase.Request, Encoding.UTF8)) |
| 239 | + { |
| 240 | + var parser = MultipartFormDataParser.Parse(stream, "boundry", Encoding.UTF8); |
| 241 | + Assert.NotNull(parser.GetParameterValue("text")); |
| 242 | + Assert.Null(parser.GetParameterValue("Text")); |
| 243 | + } |
| 244 | + } |
| 245 | + |
| 246 | + [Fact] |
| 247 | + public async Task GetParameterValueReturnsCorrectlyWithoutComparisonTypeAsync() |
| 248 | + { |
| 249 | + using (Stream stream = TestUtil.StringToStream(_testCase.Request, Encoding.UTF8)) |
| 250 | + { |
| 251 | + var parser = await MultipartFormDataParser.ParseAsync(stream, "boundry", Encoding.UTF8); |
| 252 | + Assert.NotNull(parser.GetParameterValue("text")); |
| 253 | + Assert.Null(parser.GetParameterValue("Text")); |
| 254 | + } |
| 255 | + } |
| 256 | + |
| 257 | + [Fact] |
| 258 | + public void GetParameterValueReturnsCorrectlyWithComparisonType() |
| 259 | + { |
| 260 | + using (Stream stream = TestUtil.StringToStream(_testCase.Request, Encoding.UTF8)) |
| 261 | + { |
| 262 | + var parser = MultipartFormDataParser.Parse(stream, "boundry", Encoding.UTF8); |
| 263 | + Assert.NotNull(parser.GetParameterValue("text",StringComparison.OrdinalIgnoreCase)); |
| 264 | + Assert.NotNull(parser.GetParameterValue("Text",StringComparison.OrdinalIgnoreCase)); |
| 265 | + } |
| 266 | + } |
| 267 | + |
| 268 | + [Fact] |
| 269 | + public async Task GetParameterValueReturnsCorrectlyWithComparisonTypeAsync() |
| 270 | + { |
| 271 | + using (Stream stream = TestUtil.StringToStream(_testCase.Request, Encoding.UTF8)) |
| 272 | + { |
| 273 | + var parser = await MultipartFormDataParser.ParseAsync(stream, "boundry", Encoding.UTF8); |
| 274 | + Assert.NotNull(parser.GetParameterValue("text",StringComparison.OrdinalIgnoreCase)); |
| 275 | + Assert.NotNull(parser.GetParameterValue("Text",StringComparison.OrdinalIgnoreCase)); |
| 276 | + } |
| 277 | + } |
| 278 | + |
234 | 279 | [Fact] |
235 | 280 | public void CanDetectBoundriesWithNewLineInNextBuffer() |
236 | 281 | { |
|
0 commit comments