-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
9 changed files
with
75 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
test/Microsoft.OpenApi.Readers.Tests/OpenApiReaderTests/OpenApiDiagnosticTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
using FluentAssertions; | ||
using Xunit; | ||
|
||
namespace Microsoft.OpenApi.Readers.Tests.OpenApiReaderTests | ||
{ | ||
[Collection("DefaultSettings")] | ||
public class OpenApiDiagnosticTests | ||
{ | ||
[Fact] | ||
public void DetectedSpecificationVersionShouldBeV2_0() | ||
{ | ||
using (var stream = Resources.GetStream("V2Tests/Samples/basic.v2.yaml")) | ||
{ | ||
new OpenApiStreamReader().Read(stream, out var diagnostic); | ||
|
||
diagnostic.Should().NotBeNull(); | ||
diagnostic.SpecificationVersion.Should().Be(OpenApiSpecVersion.OpenApi2_0); | ||
} | ||
} | ||
|
||
[Fact] | ||
public void DetectedSpecificationVersionShouldBeV3_0() | ||
{ | ||
using (var stream = Resources.GetStream("V3Tests/Samples/OpenApiDocument/minimalDocument.yaml")) | ||
{ | ||
new OpenApiStreamReader().Read(stream, out var diagnostic); | ||
|
||
diagnostic.Should().NotBeNull(); | ||
diagnostic.SpecificationVersion.Should().Be( OpenApiSpecVersion.OpenApi3_0); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters