コード例 #1
0
        public void ObjectSerializationShouldThrow()
        {
            var unknownTypeClass = new UnknownTypeClass {
                Field = new object()
            };

            Roundtrip(unknownTypeClass);
        }
コード例 #2
0
        public void UnknownTypeSerializationTest()
        {
            var unknownTypeClass = new UnknownTypeClass {Field = "hello"};

            var serializer = new BinarySerialization.BinarySerializer();

            var stream = new MemoryStream();
            serializer.Serialize(stream, unknownTypeClass);
        }
コード例 #3
0
        public void UnknownTypeSerializationTest()
        {
            var unknownTypeClass = new UnknownTypeClass {
                Field = "hello"
            };

            var serializer = new BinarySerializer();

            var stream = new MemoryStream();

            serializer.Serialize(stream, unknownTypeClass);
        }
コード例 #4
0
        public void ObjectSerializationShouldThrow()
        {
            var unknownTypeClass = new UnknownTypeClass {
                Field = new object()
            };

#if TESTASYNC
            Assert.Throws <AggregateException>(() => Roundtrip(unknownTypeClass));
#else
            Assert.Throws <InvalidOperationException>(() => Roundtrip(unknownTypeClass));
#endif
        }