File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
test/Microsoft.OpenApi.Tests/Models Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 6
6
using FluentAssertions ;
7
7
using Microsoft . OpenApi . Any ;
8
8
using Microsoft . OpenApi . Extensions ;
9
+ using Microsoft . OpenApi . Interfaces ;
9
10
using Microsoft . OpenApi . Models ;
10
11
using Xunit ;
11
12
using Xunit . Abstractions ;
@@ -426,5 +427,21 @@ public void SerializeMediaTypeWithObjectExamplesAsV3JsonWorks()
426
427
expected = expected . MakeLineBreaksEnvironmentNeutral ( ) ;
427
428
actual . Should ( ) . Be ( expected ) ;
428
429
}
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
+ }
429
446
}
430
447
}
You can’t perform that action at this time.
0 commit comments