Beispiel #1
0
        public void bind_add_method_factories_latebound()
        {
            // The latebound type should be used from add method factories
            PropertyTreeReader pt = LoadContent("omicron-4.xml");

            Assert.True(pt.Read());

            Omicron o = pt.Bind <Omicron>();

            Assert.True(o.G is GammaExtension);
            GammaExtension ge = (GammaExtension)o.G;

            Assert.Equal(DateTime.Parse("6/16/2012 6:48 PM"), ge.B);
        }
Beispiel #2
0
        public void bind_complex_types_latebound()
        {
            // Demonstrates that the late bound version of Gamma
            // should be used (GammaExtension); As such, the shadowed
            // property should bind correctly
            PropertyTreeReader pt = LoadContent("beta-2.xml");

            Assert.True(pt.Read());

            Beta b = pt.Bind(new Beta());

            Assert.IsInstanceOf <GammaExtension>(b.E);

            GammaExtension ge = (GammaExtension)b.E;

            Assert.Equal(DateTime.Parse("6/16/2012 6:48 PM"), ge.B);
        }