Skip to content

Commit 6a3dd01

Browse files
committed
Added test to call Transform command directly so that code coverage will actually see it.
1 parent c23694c commit 6a3dd01

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,18 @@ public async Task ShowCommandGeneratesMermaidMarkdownFileWithMermaidDiagram()
131131
Assert.Contains("graph LR", output);
132132
}
133133

134+
135+
[Fact]
136+
public async Task TransformCommandConvertsOpenApi()
137+
{
138+
var fileinfo = new FileInfo("sample.json");
139+
// create a dummy ILogger instance for testing
140+
await OpenApiService.TransformOpenApiDocument("UtilityFiles\\SampleOpenApi.yml",null, null, fileinfo, true, null, null,false,null,false,false,null,null,null,new Logger<OpenApiService>(new LoggerFactory()), new CancellationToken());
141+
142+
var output = File.ReadAllText("sample.json");
143+
Assert.NotEmpty(output);
144+
}
145+
134146
[Fact]
135147
public void InvokeTransformCommand()
136148
{

0 commit comments

Comments
 (0)