@@ -30,7 +30,7 @@ public OpenApiServiceTests()
3030 public async Task ReturnConvertedCSDLFile ( )
3131 {
3232 // Arrange
33- var filePath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "UtilityFiles\\ Todo.xml" ) ;
33+ var filePath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "UtilityFiles" , " Todo.xml") ;
3434 var fileInput = new FileInfo ( filePath ) ;
3535 var csdlStream = fileInput . OpenRead ( ) ;
3636 // Act
@@ -50,7 +50,7 @@ public async Task ReturnConvertedCSDLFile()
5050 public async Task ReturnFilteredOpenApiDocBasedOnOperationIdsAndInputCsdlDocument ( string operationIds , string tags , int expectedPathCount )
5151 {
5252 // Arrange
53- var filePath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "UtilityFiles\\ Todo.xml" ) ;
53+ var filePath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "UtilityFiles" , " Todo.xml") ;
5454 var fileInput = new FileInfo ( filePath ) ;
5555 var csdlStream = fileInput . OpenRead ( ) ;
5656
@@ -137,7 +137,7 @@ public async Task ShowCommandGeneratesMermaidMarkdownFileWithMermaidDiagram()
137137 // create a dummy ILogger instance for testing
138138 var options = new HidiOptions ( )
139139 {
140- OpenApi = "UtilityFiles\\ SampleOpenApi.yml" ,
140+ OpenApi = Path . Combine ( "UtilityFiles" , " SampleOpenApi.yml") ,
141141 Output = new FileInfo ( "sample.md" )
142142 } ;
143143
@@ -152,7 +152,7 @@ public async Task ShowCommandGeneratesMermaidHtmlFileWithMermaidDiagram()
152152 {
153153 var options = new HidiOptions ( )
154154 {
155- OpenApi = "UtilityFiles\\ SampleOpenApi.yml"
155+ OpenApi = Path . Combine ( "UtilityFiles" , " SampleOpenApi.yml")
156156 } ;
157157 var filePath = await OpenApiService . ShowOpenApiDocument ( options , _logger , new CancellationToken ( ) ) ;
158158 Assert . True ( File . Exists ( filePath ) ) ;
@@ -163,7 +163,7 @@ public async Task ShowCommandGeneratesMermaidMarkdownFileFromCsdlWithMermaidDiag
163163 {
164164 var options = new HidiOptions ( )
165165 {
166- Csdl = "UtilityFiles\\ Todo.xml" ,
166+ Csdl = Path . Combine ( "UtilityFiles" , " Todo.xml") ,
167167 CsdlFilter = "todos" ,
168168 Output = new FileInfo ( "sample.md" )
169169 } ;
@@ -201,7 +201,7 @@ await Assert.ThrowsAsync<InvalidOperationException>(async () =>
201201 public async Task ValidateCommandProcessesOpenApi ( )
202202 {
203203 // 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 ( ) ) ;
205205
206206 Assert . True ( true ) ;
207207 }
@@ -212,7 +212,7 @@ public async Task TransformCommandConvertsOpenApi()
212212 {
213213 HidiOptions options = new HidiOptions
214214 {
215- OpenApi = "UtilityFiles\\ SampleOpenApi.yml" ,
215+ OpenApi = Path . Combine ( "UtilityFiles" , " SampleOpenApi.yml") ,
216216 Output = new FileInfo ( "sample.json" ) ,
217217 CleanOutput = true ,
218218 TerseOutput = false ,
@@ -232,7 +232,7 @@ public async Task TransformCommandConvertsOpenApiWithDefaultOutputname()
232232 {
233233 HidiOptions options = new HidiOptions
234234 {
235- OpenApi = "UtilityFiles\\ SampleOpenApi.yml" ,
235+ OpenApi = Path . Combine ( "UtilityFiles" , " SampleOpenApi.yml") ,
236236 CleanOutput = true ,
237237 TerseOutput = false ,
238238 InlineLocal = false ,
@@ -250,7 +250,7 @@ public async Task TransformCommandConvertsCsdlWithDefaultOutputname()
250250 {
251251 HidiOptions options = new HidiOptions
252252 {
253- Csdl = "UtilityFiles\\ Todo.xml" ,
253+ Csdl = Path . Combine ( "UtilityFiles" , " Todo.xml") ,
254254 CleanOutput = true ,
255255 TerseOutput = false ,
256256 InlineLocal = false ,
@@ -268,7 +268,7 @@ public async Task TransformCommandConvertsOpenApiWithDefaultOutputnameAndSwitchF
268268 {
269269 HidiOptions options = new HidiOptions
270270 {
271- OpenApi = "UtilityFiles\\ SampleOpenApi.yml" ,
271+ OpenApi = Path . Combine ( "UtilityFiles" , " SampleOpenApi.yml") ,
272272 CleanOutput = true ,
273273 Version = "3.0" ,
274274 OpenApiFormat = OpenApiFormat . Yaml ,
@@ -301,10 +301,10 @@ await Assert.ThrowsAsync<ArgumentException>(async () =>
301301 [ Fact ]
302302 public async Task TransformToPowerShellCompliantOpenApi ( )
303303 {
304- var settingsPath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "UtilityFiles\\ examplepowershellsettings.json" ) ;
304+ var settingsPath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "UtilityFiles" , " examplepowershellsettings.json") ;
305305 HidiOptions options = new HidiOptions
306306 {
307- OpenApi = "UtilityFiles\\ SampleOpenApi.yml" ,
307+ OpenApi = Path . Combine ( "UtilityFiles" , " SampleOpenApi.yml") ,
308308 CleanOutput = true ,
309309 Version = "3.0" ,
310310 OpenApiFormat = OpenApiFormat . Yaml ,
@@ -324,7 +324,8 @@ public async Task TransformToPowerShellCompliantOpenApi()
324324 public void InvokeTransformCommand ( )
325325 {
326326 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" } ;
328329 var parseResult = rootCommand . Parse ( args ) ;
329330 var handler = rootCommand . Subcommands . Where ( c => c . Name == "transform" ) . First ( ) . Handler ;
330331 var context = new InvocationContext ( parseResult ) ;
@@ -340,7 +341,8 @@ public void InvokeTransformCommand()
340341 public void InvokeShowCommand ( )
341342 {
342343 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" } ;
344346 var parseResult = rootCommand . Parse ( args ) ;
345347 var handler = rootCommand . Subcommands . Where ( c => c . Name == "show" ) . First ( ) . Handler ;
346348 var context = new InvocationContext ( parseResult ) ;
@@ -355,7 +357,8 @@ public void InvokeShowCommand()
355357 public void InvokePluginCommand ( )
356358 {
357359 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 } ;
359362 var parseResult = rootCommand . Parse ( args ) ;
360363 var handler = rootCommand . Subcommands . Where ( c => c . Name == "plugin" ) . First ( ) . Handler ;
361364 var context = new InvocationContext ( parseResult ) ;
0 commit comments