public void HasProperty()
            {
                var foo = Create <IFoo>("<Foo> <A>a</A> </Foo>");

                Assert.False(XmlAdapter.For(foo).HasProperty("StringValue", foo));
                Assert.False(XmlAdapter.For(foo).HasProperty("NumberValue", foo));
                Assert.False(XmlAdapter.For(foo).HasProperty("BooleanValue", foo));
            }
Exemple #2
0
        public void Foo()
        {
            var foo = Create <IA>();

            foo.A = "a";

            CustomAssert.AreXmlEquivalent("<XX xmlns='urn:a'> <A>a</A> </XX>", XmlAdapter.For(foo).Node.Xml);
        }
        public void Foo()
        {
            var foo = Create <IA>();

            foo.A = "a";

            Assert.That(
                XmlAdapter.For(foo).Node.Xml,
                XmlEquivalent.To("<XX xmlns='urn:a'> <A>a</A> </XX>"));
        }
            public void SharedXmlAdapters()
            {
                var xml = Xml("<Foo> <A>a</A> <B>b</B> </Foo>");
                var foo = Create <IFoo>(xml);
                var bar = foo.Coerce <IBar>();

                var fooAdapter = XmlAdapter.For(foo);
                var barAdapter = XmlAdapter.For(bar);

                Assert.AreNotSame(bar, foo);
                Assert.AreNotSame(bar.This, foo.This);
                Assert.AreSame(barAdapter, fooAdapter);
            }
            public void SharedXmlAdapters()
            {
                var xml = Xml("<Foo> <A>a</A> <B>b</B> </Foo>");
                var foo = Create <IFoo>(xml);
                var bar = foo.Coerce <IBar>();

                var fooAdapter = XmlAdapter.For(foo);
                var barAdapter = XmlAdapter.For(bar);

                Assert.That(foo, Is.Not.SameAs(bar));
                Assert.That(foo.This, Is.Not.SameAs(bar.This));
                Assert.That(fooAdapter, Is.SameAs(barAdapter));
            }
Exemple #6
0
 private static IVirtual AsVirtual(object source)
 {
     return(XmlAdapter.For(source));
 }