public static void RoundtripSerializeDeserialize___Using_TestWithReadOnlyCollectionOfBaseClass___Works()
        {
            // Arrange
            var bsonConfigType = typeof(TypesToRegisterBsonSerializationConfiguration <TestWithReadOnlyCollectionOfBaseClass>);
            var jsonConfigType = typeof(TypesToRegisterJsonSerializationConfiguration <TestWithReadOnlyCollectionOfBaseClass>);

            var expected = new TestWithReadOnlyCollectionOfBaseClass
            {
                TestCollection =
                    new TestBase[]
                {
                    new TestImplementationOne {
                        One = "1", Message = "1 one"
                    },
                    new TestImplementationTwo {
                        Two = "2", Message = "2 two"
                    },
                },
            };

            void ThrowIfObjectsDiffer(DescribedSerializationBase describedSerialization, TestWithReadOnlyCollectionOfBaseClass deserialized)
            {
                deserialized.Should().NotBeNull();
                deserialized.TestCollection.Should().NotBeNull();
                deserialized.TestCollection.Count.Should().Be(2);
                deserialized.TestCollection.First().GetType().Should().Be(expected.TestCollection.First().GetType());
                deserialized.TestCollection.Skip(1).First().GetType().Should().Be(expected.TestCollection.Skip(1).First().GetType());
            }

            // Act & Assert
            expected.RoundtripSerializeWithCallbackVerification(ThrowIfObjectsDiffer, bsonConfigType, jsonConfigType);
        }
        public static void RoundtripSerializeDeserialize___Using_TestWithEmptyReadOnlyCollectionOfBaseClass___Works()
        {
            // Arrange
            var bsonConfigType = typeof(TypesToRegisterBsonSerializationConfiguration <TestWithReadOnlyCollectionOfBaseClass>);
            var jsonConfigType = typeof(TypesToRegisterJsonSerializationConfiguration <TestWithReadOnlyCollectionOfBaseClass>);

            var expected = new TestWithReadOnlyCollectionOfBaseClass {
                TestCollection = new List <TestBase>()
            };

            void ThrowIfObjectsDiffer(DescribedSerializationBase describedSerialization, TestWithReadOnlyCollectionOfBaseClass deserialized)
            {
                deserialized.Should().NotBeNull();
                deserialized.TestCollection.Should().NotBeNull();
                deserialized.TestCollection.Count.Should().Be(0);
            }

            // Act & Assert
            expected.RoundtripSerializeWithCallbackVerification(ThrowIfObjectsDiffer, bsonConfigType, jsonConfigType);
        }