-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathOpenApiEncodingTests.cs
More file actions
33 lines (29 loc) · 1.07 KB
/
OpenApiEncodingTests.cs
File metadata and controls
33 lines (29 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System.IO;
using System.Threading.Tasks;
using Microsoft.OpenApi.Reader;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V31Tests
{
[Collection("DefaultSettings")]
public class OpenApiEncodingTests
{
private const string SampleFolderPath = "V31Tests/Samples/OpenApiEncoding/";
[Fact]
public async Task ParseEncodingWithAllowReservedShouldSucceed()
{
// Act
var encoding = await OpenApiModelFactory.LoadAsync<OpenApiEncoding>(Path.Combine(SampleFolderPath, "encodingWithAllowReserved.yaml"), OpenApiSpecVersion.OpenApi3_1, new(), SettingsFixture.ReaderSettings);
// Assert
Assert.Equivalent(
new OpenApiEncoding
{
ContentType = "application/x-www-form-urlencoded",
Style = ParameterStyle.Form,
Explode = true,
AllowReserved = true
}, encoding);
}
}
}