Skip to content

Commit 8f87426

Browse files
committed
Add test to validate
1 parent 043a592 commit 8f87426

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/Microsoft.OpenApi.Tests/Models/OpenApiSchemaTests.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,5 +463,22 @@ public void SerializeAsV2ShouldSetFormatPropertyInParentSchemaIfPresentInChildre
463463
// Assert
464464
Assert.Equal(expectedV2Schema, v2Schema);
465465
}
466+
467+
[Fact]
468+
public void OpenApiSchemaCopyConstructorSucceeds()
469+
{
470+
var baseSchema = new OpenApiSchema()
471+
{
472+
Type = "string",
473+
Format = "date"
474+
};
475+
476+
var actualSchema = new OpenApiSchema(baseSchema)
477+
{
478+
Nullable = true
479+
};
480+
481+
Assert.Equal("string", actualSchema.Type);
482+
}
466483
}
467484
}

0 commit comments

Comments
 (0)