Skip to content

Commit 7583f65

Browse files
committed
linting: further path combine replacement
1 parent 217a9d5 commit 7583f65

35 files changed

Lines changed: 172 additions & 172 deletions

test/Microsoft.OpenApi.Hidi.Tests/Services/OpenApiFilterServiceTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void ReturnFilteredOpenApiDocumentBasedOnOperationIdsAndTags(string? oper
5151
public void ReturnFilteredOpenApiDocumentBasedOnPostmanCollection()
5252
{
5353
// Arrange
54-
var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "UtilityFiles", "postmanCollection_ver2.json");
54+
var filePath = Path.Join(AppDomain.CurrentDomain.BaseDirectory, "UtilityFiles", "postmanCollection_ver2.json");
5555
var fileInput = new FileInfo(filePath);
5656
var stream = fileInput.OpenRead();
5757

@@ -158,7 +158,7 @@ public void CreateFilteredDocumentUsingPredicateFromRequestUrl()
158158
public void ShouldParseNestedPostmanCollection()
159159
{
160160
// Arrange
161-
var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "UtilityFiles", "postmanCollection_ver3.json");
161+
var filePath = Path.Join(AppDomain.CurrentDomain.BaseDirectory, "UtilityFiles", "postmanCollection_ver3.json");
162162
var fileInput = new FileInfo(filePath);
163163
var stream = fileInput.OpenRead();
164164

@@ -175,7 +175,7 @@ public void ShouldParseNestedPostmanCollection()
175175
public void ThrowsExceptionWhenUrlsInCollectionAreMissingFromSourceDocument()
176176
{
177177
// Arrange
178-
var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "UtilityFiles", "postmanCollection_ver1.json");
178+
var filePath = Path.Join(AppDomain.CurrentDomain.BaseDirectory, "UtilityFiles", "postmanCollection_ver1.json");
179179
var fileInput = new FileInfo(filePath);
180180
var stream = fileInput.OpenRead();
181181

@@ -192,7 +192,7 @@ public void ThrowsExceptionWhenUrlsInCollectionAreMissingFromSourceDocument()
192192
public void ContinueProcessingWhenUrlsInCollectionAreMissingFromSourceDocument()
193193
{
194194
// Arrange
195-
var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "UtilityFiles", "postmanCollection_ver4.json");
195+
var filePath = Path.Join(AppDomain.CurrentDomain.BaseDirectory, "UtilityFiles", "postmanCollection_ver4.json");
196196
var fileInput = new FileInfo(filePath);
197197
var stream = fileInput.OpenRead();
198198

@@ -225,7 +225,7 @@ public void ThrowsInvalidOperationExceptionInCreatePredicateWhenInvalidArguments
225225
public async Task CopiesOverAllReferencedComponentsToTheSubsetDocumentCorrectly()
226226
{
227227
// Arrange
228-
var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "UtilityFiles", "docWithReusableHeadersAndExamples.yaml");
228+
var filePath = Path.Join(AppDomain.CurrentDomain.BaseDirectory, "UtilityFiles", "docWithReusableHeadersAndExamples.yaml");
229229
var operationIds = "getItems";
230230

231231
// Act

test/Microsoft.OpenApi.Readers.Tests/OpenApiReaderTests/OpenApiStreamReaderTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class OpenApiStreamReaderTests
1717
[Fact]
1818
public async Task StreamShouldCloseIfLeaveStreamOpenSettingEqualsFalse()
1919
{
20-
using var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "petStore.yaml"));
20+
using var stream = Resources.GetStream(Path.Join(SampleFolderPath, "petStore.yaml"));
2121
var settings = new OpenApiReaderSettings { LeaveStreamOpen = false };
2222
settings.AddYamlReader();
2323
(_, var diagnostic) = await OpenApiDocument.LoadAsync(stream, settings: settings, cancellationToken: TestContext.Current.CancellationToken);
@@ -28,7 +28,7 @@ public async Task StreamShouldCloseIfLeaveStreamOpenSettingEqualsFalse()
2828
[Fact]
2929
public async Task StreamShouldNotCloseIfLeaveStreamOpenSettingEqualsTrue()
3030
{
31-
using var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "petStore.yaml"));
31+
using var stream = Resources.GetStream(Path.Join(SampleFolderPath, "petStore.yaml"));
3232
var settings = new OpenApiReaderSettings { LeaveStreamOpen = true };
3333
settings.AddYamlReader();
3434
_ = await OpenApiDocument.LoadAsync(stream, settings: settings, cancellationToken: TestContext.Current.CancellationToken);
@@ -39,7 +39,7 @@ public async Task StreamShouldNotCloseIfLeaveStreamOpenSettingEqualsTrue()
3939
public async Task StreamShouldNotBeDisposedIfLeaveStreamOpenSettingIsTrueAsync()
4040
{
4141
var memoryStream = new MemoryStream();
42-
using var fileStream = Resources.GetStream(Path.Combine(SampleFolderPath, "petStore.yaml"));
42+
using var fileStream = Resources.GetStream(Path.Join(SampleFolderPath, "petStore.yaml"));
4343

4444
await fileStream.CopyToAsync(memoryStream, TestContext.Current.CancellationToken);
4545
memoryStream.Position = 0;

test/Microsoft.OpenApi.Readers.Tests/OpenApiWorkspaceTests/OpenApiWorkspaceStreamTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ public async Task LoadDocumentWithExternalReferencesInSubDirectories()
8787
var workspace = result.Document.Workspace;
8888

8989
// Assert
90-
Assert.True(workspace.Contains($"{Path.Combine(referenceBaseUri, "Directory", "PetsPage.yaml")}#/components/schemas/PetsPage"));
91-
Assert.True(workspace.Contains($"{Path.Combine(referenceBaseUri, "Directory", "Pets.yaml")}#/components/schemas/Pets"));
92-
Assert.True(workspace.Contains($"{Path.Combine(referenceBaseUri, "Directory", "Pets.yaml")}#/components/schemas/Pet"));
90+
Assert.True(workspace.Contains($"{Path.Join(referenceBaseUri, "Directory", "PetsPage.yaml")}#/components/schemas/PetsPage"));
91+
Assert.True(workspace.Contains($"{Path.Join(referenceBaseUri, "Directory", "Pets.yaml")}#/components/schemas/Pets"));
92+
Assert.True(workspace.Contains($"{Path.Join(referenceBaseUri, "Directory", "Pets.yaml")}#/components/schemas/Pet"));
9393

9494
var operationResponseSchema = document.Paths["/pets"].Operations[HttpMethod.Get].Responses["200"].Content["application/json"].Schema;
9595
Assert.IsType<OpenApiSchemaReference>(operationResponseSchema);

test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiHeaderTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void ParseHeaderWithDefaultShouldSucceed()
2121
{
2222
// Arrange
2323
JsonNode node;
24-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "headerWithDefault.yaml")))
24+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "headerWithDefault.yaml")))
2525
{
2626
node = TestHelper.CreateYamlJsonNode(stream);
2727
}
@@ -50,7 +50,7 @@ public void ParseHeaderWithEnumShouldSucceed()
5050
{
5151
// Arrange
5252
JsonNode node;
53-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "headerWithEnum.yaml")))
53+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "headerWithEnum.yaml")))
5454
{
5555
node = TestHelper.CreateYamlJsonNode(stream);
5656
}

test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiOperationTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public void ParseBasicOperationShouldSucceed()
121121
{
122122
// Arrange
123123
JsonNode node;
124-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "basicOperation.yaml")))
124+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "basicOperation.yaml")))
125125
{
126126
node = TestHelper.CreateYamlJsonNode(stream);
127127
}
@@ -156,7 +156,7 @@ public void ParseOperationWithBodyShouldSucceed()
156156
{
157157
// Arrange
158158
JsonNode node;
159-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "operationWithBody.yaml")))
159+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "operationWithBody.yaml")))
160160
{
161161
node = TestHelper.CreateYamlJsonNode(stream);
162162
}
@@ -191,7 +191,7 @@ public void ParseOperationWithResponseExamplesShouldSucceed()
191191
{
192192
// Arrange
193193
JsonNode node;
194-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "operationWithResponseExamples.yaml")))
194+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "operationWithResponseExamples.yaml")))
195195
{
196196
node = TestHelper.CreateYamlJsonNode(stream);
197197
}
@@ -257,7 +257,7 @@ public void ParseOperationWithEmptyProducesArraySetsResponseSchemaIfExists()
257257
{
258258
// Arrange
259259
JsonNode node;
260-
using var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "operationWithEmptyProducesArrayInResponse.json"));
260+
using var stream = Resources.GetStream(Path.Join(SampleFolderPath, "operationWithEmptyProducesArrayInResponse.json"));
261261
node = TestHelper.CreateYamlJsonNode(stream);
262262

263263
// Act
@@ -293,7 +293,7 @@ public void ParseOperationWithBodyAndEmptyConsumesSetsRequestBodySchemaIfExists(
293293
{
294294
// Arrange
295295
JsonNode node;
296-
using var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "operationWithBodyAndEmptyConsumes.yaml"));
296+
using var stream = Resources.GetStream(Path.Join(SampleFolderPath, "operationWithBodyAndEmptyConsumes.yaml"));
297297
node = TestHelper.CreateYamlJsonNode(stream);
298298

299299
// Act
@@ -308,7 +308,7 @@ public async Task ParseV2ResponseWithExamplesExtensionWorks()
308308
{
309309
// Arrange
310310
JsonNode node;
311-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "opWithResponseExamplesExtension.yaml")))
311+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "opWithResponseExamplesExtension.yaml")))
312312
{
313313
node = TestHelper.CreateYamlJsonNode(stream);
314314
}
@@ -358,7 +358,7 @@ public async Task LoadV3ExamplesInResponseAsExtensionsWorks()
358358
{
359359
// Arrange
360360
JsonNode node;
361-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "v3OperationWithResponseExamples.yaml")))
361+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "v3OperationWithResponseExamples.yaml")))
362362
{
363363
node = TestHelper.CreateYamlJsonNode(stream);
364364
}
@@ -408,7 +408,7 @@ public async Task LoadV2OperationWithBodyParameterExamplesWorks()
408408
{
409409
// Arrange
410410
JsonNode node;
411-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "opWithBodyParameterExamples.yaml")))
411+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "opWithBodyParameterExamples.yaml")))
412412
{
413413
node = TestHelper.CreateYamlJsonNode(stream);
414414
}
@@ -459,7 +459,7 @@ public async Task LoadV3ExamplesInRequestBodyParameterAsExtensionsWorks()
459459
{
460460
// Arrange
461461
JsonNode node;
462-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "v3OperationWithBodyParameterExamples.yaml")))
462+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "v3OperationWithBodyParameterExamples.yaml")))
463463
{
464464
node = TestHelper.CreateYamlJsonNode(stream);
465465
}

test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiParameterTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void ParseBodyParameterShouldSucceed()
2222
{
2323
// Arrange
2424
JsonNode node;
25-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "bodyParameter.yaml")))
25+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "bodyParameter.yaml")))
2626
{
2727
node = TestHelper.CreateYamlJsonNode(stream);
2828
}
@@ -41,7 +41,7 @@ public void ParsePathParameterShouldSucceed()
4141
{
4242
// Arrange
4343
JsonNode node;
44-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "pathParameter.yaml")))
44+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "pathParameter.yaml")))
4545
{
4646
node = TestHelper.CreateYamlJsonNode(stream);
4747
}
@@ -70,7 +70,7 @@ public void ParseQueryParameterShouldSucceed()
7070
{
7171
// Arrange
7272
JsonNode node;
73-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "queryParameter.yaml")))
73+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "queryParameter.yaml")))
7474
{
7575
node = TestHelper.CreateYamlJsonNode(stream);
7676
}
@@ -105,7 +105,7 @@ public void ParseParameterWithNullLocationShouldSucceed()
105105
{
106106
// Arrange
107107
JsonNode node;
108-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "parameterWithNullLocation.yaml")))
108+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "parameterWithNullLocation.yaml")))
109109
{
110110
node = TestHelper.CreateYamlJsonNode(stream);
111111
}
@@ -134,7 +134,7 @@ public void ParseParameterWithNoLocationShouldSucceed()
134134
{
135135
// Arrange
136136
JsonNode node;
137-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "parameterWithNoLocation.yaml")))
137+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "parameterWithNoLocation.yaml")))
138138
{
139139
node = TestHelper.CreateYamlJsonNode(stream);
140140
}
@@ -163,7 +163,7 @@ public void ParseParameterWithNoSchemaShouldSucceed()
163163
{
164164
// Arrange
165165
JsonNode node;
166-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "parameterWithNoSchema.yaml")))
166+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "parameterWithNoSchema.yaml")))
167167
{
168168
node = TestHelper.CreateYamlJsonNode(stream);
169169
}
@@ -188,7 +188,7 @@ public void ParseParameterWithUnknownLocationShouldSucceed()
188188
{
189189
// Arrange
190190
JsonNode node;
191-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "parameterWithUnknownLocation.yaml")))
191+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "parameterWithUnknownLocation.yaml")))
192192
{
193193
node = TestHelper.CreateYamlJsonNode(stream);
194194
}
@@ -217,7 +217,7 @@ public void ParseParameterWithDefaultShouldSucceed()
217217
{
218218
// Arrange
219219
JsonNode node;
220-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "parameterWithDefault.yaml")))
220+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "parameterWithDefault.yaml")))
221221
{
222222
node = TestHelper.CreateYamlJsonNode(stream);
223223
}
@@ -247,7 +247,7 @@ public void ParseParameterWithEnumShouldSucceed()
247247
{
248248
// Arrange
249249
JsonNode node;
250-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "parameterWithEnum.yaml")))
250+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "parameterWithEnum.yaml")))
251251
{
252252
node = TestHelper.CreateYamlJsonNode(stream);
253253
}
@@ -290,7 +290,7 @@ public void ParseFormDataParameterShouldSucceed()
290290
""format"": ""binary""
291291
}";
292292
JsonNode node;
293-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "formDataParameter.json")))
293+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "formDataParameter.json")))
294294
{
295295
node = TestHelper.CreateYamlJsonNode(stream);
296296
}

test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiPathItemTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public class OpenApiPathItemTests
250250
public void ParseBasicPathItemWithFormDataShouldSucceed()
251251
{
252252
// Arrange
253-
using var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "basicPathItemWithFormData.yaml"));
253+
using var stream = Resources.GetStream(Path.Join(SampleFolderPath, "basicPathItemWithFormData.yaml"));
254254
var node = TestHelper.CreateYamlJsonNode(stream);
255255

256256
// Act
@@ -265,7 +265,7 @@ public void ParsePathItemWithFormDataPathParameterShouldSucceed()
265265
{
266266
// Arrange
267267
JsonNode node;
268-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "pathItemWithFormDataPathParameter.yaml")))
268+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "pathItemWithFormDataPathParameter.yaml")))
269269
{
270270
node = TestHelper.CreateYamlJsonNode(stream);
271271
}
@@ -284,7 +284,7 @@ public void ParsePathItemBodyDataPathParameterShouldSucceed()
284284
{
285285
// Arrange
286286
JsonNode node;
287-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "pathItemWithBodyPathParameter.yaml")))
287+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "pathItemWithBodyPathParameter.yaml")))
288288
{
289289
node = TestHelper.CreateYamlJsonNode(stream);
290290
}

test/Microsoft.OpenApi.Readers.Tests/V2Tests/OpenApiSchemaTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void ParseSchemaWithDefaultShouldSucceed()
2626
{
2727
// Arrange
2828
JsonNode node;
29-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "schemaWithDefault.yaml")))
29+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "schemaWithDefault.yaml")))
3030
{
3131
node = TestHelper.CreateYamlJsonNode(stream);
3232
}
@@ -48,7 +48,7 @@ public void ParseSchemaWithExampleShouldSucceed()
4848
{
4949
// Arrange
5050
JsonNode node;
51-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "schemaWithExample.yaml")))
51+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "schemaWithExample.yaml")))
5252
{
5353
node = TestHelper.CreateYamlJsonNode(stream);
5454
}
@@ -71,7 +71,7 @@ public void ParseSchemaWithEnumShouldSucceed()
7171
{
7272
// Arrange
7373
JsonNode node;
74-
using (var stream = Resources.GetStream(Path.Combine(SampleFolderPath, "schemaWithEnum.yaml")))
74+
using (var stream = Resources.GetStream(Path.Join(SampleFolderPath, "schemaWithEnum.yaml")))
7575
{
7676
node = TestHelper.CreateYamlJsonNode(stream);
7777
}
@@ -160,7 +160,7 @@ public async Task SerializeSchemaWithNullableShouldSucceed()
160160
var expected = @"type: string
161161
x-nullable: true";
162162

163-
var path = Path.Combine(SampleFolderPath, "schemaWithNullableExtension.yaml");
163+
var path = Path.Join(SampleFolderPath, "schemaWithNullableExtension.yaml");
164164

165165
// Act
166166
var schema = await OpenApiModelFactory.LoadAsync<OpenApiSchema>(path, OpenApiSpecVersion.OpenApi2_0, new(), SettingsFixture.ReaderSettings, token: TestContext.Current.CancellationToken);
@@ -180,7 +180,7 @@ public async Task SerializeSchemaWithOnlyNullableShouldSucceed()
180180
// Arrange
181181
var expected = @"{ }";
182182

183-
var path = Path.Combine(SampleFolderPath, "schemaWithOnlyNullableExtension.yaml");
183+
var path = Path.Join(SampleFolderPath, "schemaWithOnlyNullableExtension.yaml");
184184

185185
// Act
186186
var schema = await OpenApiModelFactory.LoadAsync<OpenApiSchema>(path, OpenApiSpecVersion.OpenApi2_0, new(), SettingsFixture.ReaderSettings, token: TestContext.Current.CancellationToken);

0 commit comments

Comments
 (0)