@@ -47,17 +47,18 @@ public void ParseDocumentFromInlineStringShouldSucceed()
47
47
} ) ;
48
48
49
49
context . ShouldBeEquivalentTo (
50
- new OpenApiDiagnostic ( ) ) ;
50
+ new OpenApiDiagnostic ( ) { SpecificationVersion = OpenApiSpecVersion . OpenApi3_0 } ) ;
51
51
}
52
52
53
53
[ Fact ]
54
54
public void ParseBasicDocumentWithMultipleServersShouldSucceed ( )
55
55
{
56
56
using ( var stream = Resources . GetStream ( Path . Combine ( SampleFolderPath , "basicDocumentWithMultipleServers.yaml" ) ) )
57
57
{
58
- var openApiDoc = new OpenApiStreamReader ( ) . Read ( stream , out var context ) ;
58
+ var openApiDoc = new OpenApiStreamReader ( ) . Read ( stream , out var diagnostic ) ;
59
59
60
- context . ShouldBeEquivalentTo ( new OpenApiDiagnostic ( ) ) ;
60
+ diagnostic . ShouldBeEquivalentTo (
61
+ new OpenApiDiagnostic ( ) { SpecificationVersion = OpenApiSpecVersion . OpenApi3_0 } ) ;
61
62
62
63
openApiDoc . ShouldBeEquivalentTo (
63
64
new OpenApiDocument
@@ -89,7 +90,7 @@ public void ParseBrokenMinimalDocumentShouldYieldExpectedDiagnostic()
89
90
{
90
91
using ( var stream = Resources . GetStream ( Path . Combine ( SampleFolderPath , "brokenMinimalDocument.yaml" ) ) )
91
92
{
92
- var openApiDoc = new OpenApiStreamReader ( ) . Read ( stream , out var context ) ;
93
+ var openApiDoc = new OpenApiStreamReader ( ) . Read ( stream , out var diagnostic ) ;
93
94
94
95
openApiDoc . ShouldBeEquivalentTo (
95
96
new OpenApiDocument
@@ -100,13 +101,14 @@ public void ParseBrokenMinimalDocumentShouldYieldExpectedDiagnostic()
100
101
}
101
102
} ) ;
102
103
103
- context . ShouldBeEquivalentTo (
104
+ diagnostic . ShouldBeEquivalentTo (
104
105
new OpenApiDiagnostic
105
106
{
106
107
Errors =
107
108
{
108
109
new OpenApiError ( "#/info" , "title is a required property" )
109
- }
110
+ } ,
111
+ SpecificationVersion = OpenApiSpecVersion . OpenApi3_0
110
112
} ) ;
111
113
}
112
114
}
@@ -116,7 +118,7 @@ public void ParseMinimalDocumentShouldSucceed()
116
118
{
117
119
using ( var stream = Resources . GetStream ( Path . Combine ( SampleFolderPath , "minimalDocument.yaml" ) ) )
118
120
{
119
- var openApiDoc = new OpenApiStreamReader ( ) . Read ( stream , out var context ) ;
121
+ var openApiDoc = new OpenApiStreamReader ( ) . Read ( stream , out var diagnostic ) ;
120
122
121
123
openApiDoc . ShouldBeEquivalentTo (
122
124
new OpenApiDocument
@@ -128,8 +130,8 @@ public void ParseMinimalDocumentShouldSucceed()
128
130
}
129
131
} ) ;
130
132
131
- context . ShouldBeEquivalentTo (
132
- new OpenApiDiagnostic ( ) ) ;
133
+ diagnostic . ShouldBeEquivalentTo (
134
+ new OpenApiDiagnostic ( ) { SpecificationVersion = OpenApiSpecVersion . OpenApi3_0 } ) ;
133
135
}
134
136
}
135
137
@@ -541,7 +543,8 @@ public void ParseStandardPetStoreDocumentShouldSucceed()
541
543
actual . ShouldBeEquivalentTo ( expected ) ;
542
544
}
543
545
544
- context . ShouldBeEquivalentTo ( new OpenApiDiagnostic ( ) ) ;
546
+ context . ShouldBeEquivalentTo (
547
+ new OpenApiDiagnostic ( ) { SpecificationVersion = OpenApiSpecVersion . OpenApi3_0 } ) ;
545
548
}
546
549
547
550
[ Fact ]
@@ -1042,7 +1045,8 @@ public void ParseModifiedPetStoreDocumentWithTagAndSecurityShouldSucceed()
1042
1045
actual . ShouldBeEquivalentTo ( expected ) ;
1043
1046
}
1044
1047
1045
- context . ShouldBeEquivalentTo ( new OpenApiDiagnostic ( ) ) ;
1048
+ context . ShouldBeEquivalentTo (
1049
+ new OpenApiDiagnostic ( ) { SpecificationVersion = OpenApiSpecVersion . OpenApi3_0 } ) ;
1046
1050
}
1047
1051
1048
1052
[ Fact ]
@@ -1057,7 +1061,8 @@ public void ParsePetStoreExpandedShouldSucceed()
1057
1061
// TODO: Create the object in memory and compare with the one read from YAML file.
1058
1062
}
1059
1063
1060
- context . ShouldBeEquivalentTo ( new OpenApiDiagnostic ( ) ) ;
1064
+ context . ShouldBeEquivalentTo (
1065
+ new OpenApiDiagnostic ( ) { SpecificationVersion = OpenApiSpecVersion . OpenApi3_0 } ) ;
1061
1066
}
1062
1067
}
1063
1068
}
0 commit comments