mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-24 09:48:51 +02:00
Add more tests for WireMockOpenApiParser (#1294)
This commit is contained in:
@@ -32,7 +32,7 @@ public class WireMockOpenApiParserTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task FromText_ShouldReturnMappings()
|
||||
public async Task FromText_UsingYaml_ShouldReturnMappings()
|
||||
{
|
||||
// Arrange
|
||||
var settings = new WireMockOpenApiParserSettings
|
||||
@@ -48,5 +48,23 @@ public class WireMockOpenApiParserTests
|
||||
// Verify
|
||||
await Verifier.Verify(mappings);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task FromText_UsingJson_WithPlainTextExample_ShouldReturnMappings()
|
||||
{
|
||||
// Arrange
|
||||
var settings = new WireMockOpenApiParserSettings
|
||||
{
|
||||
ExampleValues = _exampleValuesMock.Object
|
||||
};
|
||||
|
||||
var openApiDocument = await File.ReadAllTextAsync(Path.Combine("OpenApiParser", "oas-content-example.json"));
|
||||
|
||||
// Act
|
||||
var mappings = _sut.FromText(openApiDocument, settings, out _);
|
||||
|
||||
// Verify
|
||||
await Verifier.Verify(mappings);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user