public void CanWriteExampleObjectAsReferenceObjectJson() { // Arrange string expect = @" { ""$ref"": ""#/components/schemas/Address"" } ".Replace(); OpenApiExample example = new OpenApiExample { Reference = new OpenApiReference("#/components/schemas/Address") }; // Act & Assert Assert.Equal(expect, example.WriteToJson()); }
public void CanWriteBasicExampleObjectAsJson() { // Arrange string expect = @" { ""summary"": ""A bar example"", ""externalValue"": ""http://example.org/examples/address-example.xml"" } ".Replace(); OpenApiExample example = new OpenApiExample { Summary = "A bar example", ExternalValue = new Uri("http://example.org/examples/address-example.xml") }; // Act & Assert Assert.Equal(expect, example.WriteToJson()); }