Skip to content

Commit 5901f49

Browse files
committed
Add test to bump up test coverage
1 parent 887748e commit 5901f49

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using FluentAssertions;
77
using Microsoft.OpenApi.Any;
88
using Microsoft.OpenApi.Extensions;
9+
using Microsoft.OpenApi.Interfaces;
910
using Microsoft.OpenApi.Models;
1011
using Xunit;
1112
using Xunit.Abstractions;
@@ -426,5 +427,21 @@ public void SerializeMediaTypeWithObjectExamplesAsV3JsonWorks()
426427
expected = expected.MakeLineBreaksEnvironmentNeutral();
427428
actual.Should().Be(expected);
428429
}
430+
431+
[Fact]
432+
public void MediaTypeCopyConstructorWorks()
433+
{
434+
var clone = new OpenApiMediaType(MediaTypeWithObjectExamples)
435+
{
436+
Example = 42,
437+
Examples = new Dictionary<string, OpenApiExample>(),
438+
Encoding = new Dictionary<string, OpenApiEncoding>(),
439+
Extensions = new Dictionary<string, IOpenApiExtension>()
440+
};
441+
442+
// Assert
443+
MediaTypeWithObjectExamples.Examples.Should().NotBeEquivalentTo(clone.Examples);
444+
MediaTypeWithObjectExamples.Example.Should().Be(null);
445+
}
429446
}
430447
}

0 commit comments

Comments
 (0)