Exemplo n.º 1
0
        public void Should_serialize_and_deserialize_status()
        {
            TypeConverterStringSerializer <Status> .Register();

            var source = new TestObject
            {
                Status = Status.Published
            };

            var document = new BsonDocument();

            using (var writer = new BsonDocumentWriter(document))
            {
                BsonSerializer.Serialize(writer, source);

                writer.Flush();
            }

            using (var reader = new BsonDocumentReader(document))
            {
                var result = BsonSerializer.Deserialize <TestObject>(reader);

                Assert.Equal(source.Status, result.Status);
            }
        }
Exemplo n.º 2
0
        static AssetQueryTests()
        {
            DomainIdSerializer.Register();

            TypeConverterStringSerializer <RefToken> .Register();

            TypeConverterStringSerializer <Status> .Register();

            InstantSerializer.Register();
        }
Exemplo n.º 3
0
 static MongoContentRepository()
 {
     TypeConverterStringSerializer <Status> .Register();
 }