Skip to content

Commit b29f5da

Browse files
committed
chore: adds missing unit tests for 32 after main refresh
Signed-off-by: Vincent Biret <[email protected]>
1 parent 0f84c3e commit b29f5da

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
using System.IO;
5+
using System.Threading.Tasks;
6+
using Microsoft.OpenApi.Reader;
7+
using Xunit;
8+
9+
namespace Microsoft.OpenApi.Readers.Tests.V32Tests
10+
{
11+
[Collection("DefaultSettings")]
12+
public class OpenApiEncodingTests
13+
{
14+
private const string SampleFolderPath = "V32Tests/Samples/OpenApiEncoding/";
15+
16+
[Fact]
17+
public async Task ParseEncodingWithAllowReservedShouldSucceed()
18+
{
19+
// Act
20+
var encoding = await OpenApiModelFactory.LoadAsync<OpenApiEncoding>(Path.Combine(SampleFolderPath, "encodingWithAllowReserved.yaml"), OpenApiSpecVersion.OpenApi3_2, new(), SettingsFixture.ReaderSettings);
21+
22+
// Assert
23+
Assert.Equivalent(
24+
new OpenApiEncoding
25+
{
26+
ContentType = "application/x-www-form-urlencoded",
27+
Style = ParameterStyle.Form,
28+
Explode = true,
29+
AllowReserved = true
30+
}, encoding);
31+
}
32+
}
33+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#encodingObject
2+
contentType: application/x-www-form-urlencoded
3+
style: form
4+
explode: true
5+
allowReserved: true

0 commit comments

Comments
 (0)