Exemplo n.º 1
0
        public void TestObjectField()
        {
            AmfRegistry registry = new AmfRegistry();
            registry.RegisterClassAlias(typeof(A));
            registry.RegisterClassAlias(typeof(C));

            C c = new C();
            c.OtherClass = new A();

            C result = AmfReader.Read(registry, AmfWriter.Write(registry, c)) as C;

            Assert.IsTrue(result.OtherClass is A);
        }
Exemplo n.º 2
0
        public void TestNesting()
        {
            AmfRegistry registry = new AmfRegistry();
            registry.RegisterClassAlias(typeof(A));
            registry.RegisterClassAlias(typeof(B));

            A a = new A();
            B b = new B();

            AmfArray array = AmfArray.Dense(a, b);

            object nullResult = AmfReader.Read(registry, AmfWriter.Write(registry, array));

            a.B = b;

            object nestedResult = AmfReader.Read(registry, AmfWriter.Write(registry, array));
        }