public void TestSerializationByIdNullReference() { byte[] buffer = Protocol.Serialize((ConcreteChildById)null); ConcreteChildById concreteObj2 = (ConcreteChildById)Protocol.Deserialize(buffer); Assert.That(concreteObj2, Is.Null); }
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)); }
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); }
public NullMembers(ConcreteChildByValue nullMember1, ConcreteChildById nullMember2, int nonNullMember3) { this.nullMember1 = nullMember1; this.nullMember2 = nullMember2; this.nonNullMember3 = nonNullMember3; }