Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoSuter committed Jun 14, 2018
1 parent 13655c2 commit 55ac39e
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ public class ClassWithExtensionData
}

[Fact]
public async Task When_class_has_property_with_JsonExtensionDataAttribute_on_property_then_AdditionalProperties_schema_is_set()
public async Task When_schema_has_AdditionProperties_schema_then_JsonExtensionDataAttribute_is_generated()
{
//// Arrange
var schema = await JsonSchema4.FromTypeAsync<ClassWithExtensionData>(new JsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 });
Expand All @@ -1620,9 +1620,7 @@ public async Task When_class_has_property_with_JsonExtensionDataAttribute_on_pro
var output = generator.GenerateFile("PersonAddress");

//// Assert
Assert.Equal(1, schema.ActualProperties.Count);
Assert.True(schema.AllowAdditionalProperties);
Assert.True(schema.AdditionalPropertiesSchema.ActualSchema.IsAnyType);
Assert.Contains("JsonExtensionData", output);
}

private static void AssertCompile(string code)
Expand Down

0 comments on commit 55ac39e

Please sign in to comment.