@@ -30,7 +30,7 @@ public OpenApiServiceTests()
30
30
public async Task ReturnConvertedCSDLFile ( )
31
31
{
32
32
// Arrange
33
- var filePath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "UtilityFiles\\ Todo.xml" ) ;
33
+ var filePath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "UtilityFiles" , " Todo.xml") ;
34
34
var fileInput = new FileInfo ( filePath ) ;
35
35
var csdlStream = fileInput . OpenRead ( ) ;
36
36
// Act
@@ -50,7 +50,7 @@ public async Task ReturnConvertedCSDLFile()
50
50
public async Task ReturnFilteredOpenApiDocBasedOnOperationIdsAndInputCsdlDocument ( string operationIds , string tags , int expectedPathCount )
51
51
{
52
52
// Arrange
53
- var filePath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "UtilityFiles\\ Todo.xml" ) ;
53
+ var filePath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "UtilityFiles" , " Todo.xml") ;
54
54
var fileInput = new FileInfo ( filePath ) ;
55
55
var csdlStream = fileInput . OpenRead ( ) ;
56
56
@@ -137,7 +137,7 @@ public async Task ShowCommandGeneratesMermaidMarkdownFileWithMermaidDiagram()
137
137
// create a dummy ILogger instance for testing
138
138
var options = new HidiOptions ( )
139
139
{
140
- OpenApi = "UtilityFiles\\ SampleOpenApi.yml" ,
140
+ OpenApi = Path . Combine ( "UtilityFiles" , " SampleOpenApi.yml") ,
141
141
Output = new FileInfo ( "sample.md" )
142
142
} ;
143
143
@@ -152,7 +152,7 @@ public async Task ShowCommandGeneratesMermaidHtmlFileWithMermaidDiagram()
152
152
{
153
153
var options = new HidiOptions ( )
154
154
{
155
- OpenApi = "UtilityFiles\\ SampleOpenApi.yml"
155
+ OpenApi = Path . Combine ( "UtilityFiles" , " SampleOpenApi.yml")
156
156
} ;
157
157
var filePath = await OpenApiService . ShowOpenApiDocument ( options , _logger , new CancellationToken ( ) ) ;
158
158
Assert . True ( File . Exists ( filePath ) ) ;
@@ -163,7 +163,7 @@ public async Task ShowCommandGeneratesMermaidMarkdownFileFromCsdlWithMermaidDiag
163
163
{
164
164
var options = new HidiOptions ( )
165
165
{
166
- Csdl = "UtilityFiles\\ Todo.xml" ,
166
+ Csdl = Path . Combine ( "UtilityFiles" , " Todo.xml") ,
167
167
CsdlFilter = "todos" ,
168
168
Output = new FileInfo ( "sample.md" )
169
169
} ;
@@ -201,7 +201,7 @@ await Assert.ThrowsAsync<InvalidOperationException>(async () =>
201
201
public async Task ValidateCommandProcessesOpenApi ( )
202
202
{
203
203
// create a dummy ILogger instance for testing
204
- await OpenApiService . ValidateOpenApiDocument ( "UtilityFiles\\ SampleOpenApi.yml" , _logger , new CancellationToken ( ) ) ;
204
+ await OpenApiService . ValidateOpenApiDocument ( Path . Combine ( "UtilityFiles" , " SampleOpenApi.yml") , _logger , new CancellationToken ( ) ) ;
205
205
206
206
Assert . True ( true ) ;
207
207
}
@@ -212,7 +212,7 @@ public async Task TransformCommandConvertsOpenApi()
212
212
{
213
213
HidiOptions options = new HidiOptions
214
214
{
215
- OpenApi = "UtilityFiles\\ SampleOpenApi.yml" ,
215
+ OpenApi = Path . Combine ( "UtilityFiles" , " SampleOpenApi.yml") ,
216
216
Output = new FileInfo ( "sample.json" ) ,
217
217
CleanOutput = true ,
218
218
TerseOutput = false ,
@@ -232,7 +232,7 @@ public async Task TransformCommandConvertsOpenApiWithDefaultOutputname()
232
232
{
233
233
HidiOptions options = new HidiOptions
234
234
{
235
- OpenApi = "UtilityFiles\\ SampleOpenApi.yml" ,
235
+ OpenApi = Path . Combine ( "UtilityFiles" , " SampleOpenApi.yml") ,
236
236
CleanOutput = true ,
237
237
TerseOutput = false ,
238
238
InlineLocal = false ,
@@ -250,7 +250,7 @@ public async Task TransformCommandConvertsCsdlWithDefaultOutputname()
250
250
{
251
251
HidiOptions options = new HidiOptions
252
252
{
253
- Csdl = "UtilityFiles\\ Todo.xml" ,
253
+ Csdl = Path . Combine ( "UtilityFiles" , " Todo.xml") ,
254
254
CleanOutput = true ,
255
255
TerseOutput = false ,
256
256
InlineLocal = false ,
@@ -268,7 +268,7 @@ public async Task TransformCommandConvertsOpenApiWithDefaultOutputnameAndSwitchF
268
268
{
269
269
HidiOptions options = new HidiOptions
270
270
{
271
- OpenApi = "UtilityFiles\\ SampleOpenApi.yml" ,
271
+ OpenApi = Path . Combine ( "UtilityFiles" , " SampleOpenApi.yml") ,
272
272
CleanOutput = true ,
273
273
Version = "3.0" ,
274
274
OpenApiFormat = OpenApiFormat . Yaml ,
@@ -301,10 +301,10 @@ await Assert.ThrowsAsync<ArgumentException>(async () =>
301
301
[ Fact ]
302
302
public async Task TransformToPowerShellCompliantOpenApi ( )
303
303
{
304
- var settingsPath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "UtilityFiles\\ examplepowershellsettings.json" ) ;
304
+ var settingsPath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "UtilityFiles" , " examplepowershellsettings.json") ;
305
305
HidiOptions options = new HidiOptions
306
306
{
307
- OpenApi = "UtilityFiles\\ SampleOpenApi.yml" ,
307
+ OpenApi = Path . Combine ( "UtilityFiles" , " SampleOpenApi.yml") ,
308
308
CleanOutput = true ,
309
309
Version = "3.0" ,
310
310
OpenApiFormat = OpenApiFormat . Yaml ,
@@ -324,7 +324,8 @@ public async Task TransformToPowerShellCompliantOpenApi()
324
324
public void InvokeTransformCommand ( )
325
325
{
326
326
var rootCommand = Program . CreateRootCommand ( ) ;
327
- var args = new string [ ] { "transform" , "-d" , ".\\ UtilityFiles\\ SampleOpenApi.yml" , "-o" , "sample.json" , "--co" } ;
327
+ var openapi = Path . Combine ( "." , "UtilityFiles" , "SampleOpenApi.yml" ) ;
328
+ var args = new string [ ] { "transform" , "-d" , openapi , "-o" , "sample.json" , "--co" } ;
328
329
var parseResult = rootCommand . Parse ( args ) ;
329
330
var handler = rootCommand . Subcommands . Where ( c => c . Name == "transform" ) . First ( ) . Handler ;
330
331
var context = new InvocationContext ( parseResult ) ;
@@ -340,7 +341,8 @@ public void InvokeTransformCommand()
340
341
public void InvokeShowCommand ( )
341
342
{
342
343
var rootCommand = Program . CreateRootCommand ( ) ;
343
- var args = new string [ ] { "show" , "-d" , ".\\ UtilityFiles\\ SampleOpenApi.yml" , "-o" , "sample.md" } ;
344
+ var openapi = Path . Combine ( "." , "UtilityFiles" , "SampleOpenApi.yml" ) ;
345
+ var args = new string [ ] { "show" , "-d" , openapi , "-o" , "sample.md" } ;
344
346
var parseResult = rootCommand . Parse ( args ) ;
345
347
var handler = rootCommand . Subcommands . Where ( c => c . Name == "show" ) . First ( ) . Handler ;
346
348
var context = new InvocationContext ( parseResult ) ;
@@ -355,7 +357,8 @@ public void InvokeShowCommand()
355
357
public void InvokePluginCommand ( )
356
358
{
357
359
var rootCommand = Program . CreateRootCommand ( ) ;
358
- var args = new string [ ] { "plugin" , "-m" , ".\\ UtilityFiles\\ exampleapimanifest.json" , "--of" , AppDomain . CurrentDomain . BaseDirectory } ;
360
+ var manifest = Path . Combine ( "." , "UtilityFiles" , "exampleapimanifest.json" ) ;
361
+ var args = new string [ ] { "plugin" , "-m" , manifest , "--of" , AppDomain . CurrentDomain . BaseDirectory } ;
359
362
var parseResult = rootCommand . Parse ( args ) ;
360
363
var handler = rootCommand . Subcommands . Where ( c => c . Name == "plugin" ) . First ( ) . Handler ;
361
364
var context = new InvocationContext ( parseResult ) ;
0 commit comments