Skip to content

Commit

Permalink
Add test to validate
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieKimani1 committed Dec 6, 2022
1 parent 043a592 commit 8f87426
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/Microsoft.OpenApi.Tests/Models/OpenApiSchemaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,5 +463,22 @@ public void SerializeAsV2ShouldSetFormatPropertyInParentSchemaIfPresentInChildre
// Assert
Assert.Equal(expectedV2Schema, v2Schema);
}

[Fact]
public void OpenApiSchemaCopyConstructorSucceeds()
{
var baseSchema = new OpenApiSchema()
{
Type = "string",
Format = "date"
};

var actualSchema = new OpenApiSchema(baseSchema)
{
Nullable = true
};

Assert.Equal("string", actualSchema.Type);
}
}
}

0 comments on commit 8f87426

Please sign in to comment.