private static void CheckUInt64(ulong expectedValue, int expectedSize) { IFieldWriter writer = new FieldWriter(); writer.Write(expectedValue); IFieldReader reader = new FieldReader(writer.ToArray()); ulong actualValue = reader.ReadUInt64(); Assert.AreEqual(expectedValue, actualValue, "Expected deserialized value "); if (expectedSize > 0) { Assert.AreEqual(expectedSize, writer.Position, "Unexpected size for {0} ", expectedValue); } }