コード例 #1
0
        public void TestSerializationByIdNullReference()
        {
            byte[]            buffer       = Protocol.Serialize((ConcreteChildById)null);
            ConcreteChildById concreteObj2 = (ConcreteChildById)Protocol.Deserialize(buffer);

            Assert.That(concreteObj2, Is.Null);
        }
コード例 #2
0
            public static object Deserialize(StreamBuffer inBuffer, short length)
            {
                ConcreteChildByValue nullMember1 = (ConcreteChildByValue)DeserializeObject(inBuffer);
                ConcreteChildById    nullMember2 = (ConcreteChildById)DeserializeObject(inBuffer);
                int nonNullMember3;
                int offset;

                byte[] buf = inBuffer.GetBufferAndAdvance(sizeof(int), out offset);
                Protocol.Deserialize(out nonNullMember3, buf, ref offset);
                return(new NullMembers(nullMember1, nullMember2, nonNullMember3));
            }
コード例 #3
0
        public void TestSerializationByIdBaseType()
        {
            ConcreteChildById concreteObj = new ConcreteChildById(12345678, 87654321);

            NetworkableId <ConcreteChildById> .Add(concreteObj);

            byte[]            buffer       = Protocol.Serialize((AbstractBaseById)concreteObj);
            ConcreteChildById concreteObj2 = (ConcreteChildById)Protocol.Deserialize(buffer);

            Assert.That(concreteObj2, Is.EqualTo(concreteObj));

            NetworkableId <ConcreteChildById> .Remove(concreteObj);
        }
コード例 #4
0
 public NullMembers(ConcreteChildByValue nullMember1, ConcreteChildById nullMember2, int nonNullMember3)
 {
     this.nullMember1    = nullMember1;
     this.nullMember2    = nullMember2;
     this.nonNullMember3 = nonNullMember3;
 }