示例#1
0
        public void DefaultSubtypeForwardTest()
        {
            var expected = new DefaultSubtypeContainerClass
            {
                Value = new SubclassA()
            };

            var actual = Roundtrip(expected);

            Assert.AreEqual(1, actual.Indicator);
            Assert.AreEqual(typeof(SubclassA), actual.Value.GetType());
        }
示例#2
0
        public void DefaultSubtypeAllowOnSerialize()
        {
            var expected = new DefaultSubtypeContainerClass
            {
                Indicator = 33,
                Value     = new DefaultSubtypeClass()
            };

            var actual = Roundtrip(expected);

            Assert.AreEqual(33, actual.Indicator);
            Assert.AreEqual(typeof(DefaultSubtypeClass), actual.Value.GetType());
        }