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