コード例 #1
0
        public void SubtypesOnUnknownTypeFieldShouldThrowBindingException()
        {
            var unknownTypeClass = new InvalidUnknownTypeClass { Field = "hello" };

            var serializer = new BinarySerialization.BinarySerializer();

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

            var serializer = new BinarySerializer();

            var stream = new MemoryStream();

            Assert.Throws <BindingException>(() => serializer.Serialize(stream, unknownTypeClass));
        }