Skip to content

Commit

Permalink
- improves coverage of defensive programing
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet committed May 27, 2021
1 parent 7e115ec commit 386219f
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@ public class OpenApiSchemaExtensionsTests {
[Fact]
public void Defensive() {
Assert.Empty(OpenApiSchemaExtensions.GetSchemaReferenceIds(null));
var schema = new OpenApiSchema{
AnyOf = null
};
Assert.Null(schema.AnyOf);
Assert.Empty(schema.GetSchemaReferenceIds());
schema = new() {
AllOf = null
};
Assert.Null(schema.AllOf);
Assert.Empty(schema.GetSchemaReferenceIds());
schema = new() {
OneOf = null
};
Assert.Null(schema.OneOf);
Assert.Empty(schema.GetSchemaReferenceIds());
schema = new() {
Properties = null
};
Assert.Null(schema.Properties);
Assert.Empty(schema.GetSchemaReferenceIds());
}
[Fact]
public void GetSchemaTitleAllOf() {
Expand Down

0 comments on commit 386219f

Please sign in to comment.