-
Notifications
You must be signed in to change notification settings - Fork 276
Expand file tree
/
Copy pathOpenApiResponseTests.cs
More file actions
33 lines (28 loc) · 1.05 KB
/
OpenApiResponseTests.cs
File metadata and controls
33 lines (28 loc) · 1.05 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.Linq;
using FluentAssertions;
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Readers.ParseNodes;
using Microsoft.OpenApi.Readers.V3;
using Xunit;
namespace Microsoft.OpenApi.Readers.Tests.V3Tests
{
[Collection("DefaultSettings")]
public class OpenApiResponseTests
{
private const string SampleFolderPath = "V3Tests/Samples/OpenApiResponse/";
[Fact]
public void ResponseWithReferencedHeaderShouldReferenceComponent()
{
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "responseWithHeaderReference.yaml")))
{
var openApiDoc = new OpenApiStreamReader().Read(stream, out var diagnostic);
var response = openApiDoc.Components.Responses["Test"];
Assert.Same(response.Headers.First().Value, openApiDoc.Components.Headers.First().Value);
}
}
}
}