public async Task TestDeserializationWithIBDateTimeNull()
        {
            var stream = new MemoryStream();
            var fieldsStream = new FieldsStream(stream);
            var message = new MessageWithIBDateTime {Field = null};

            await this.serializer.Write(message, fieldsStream, CancellationToken.None);

            stream.Seek(0, SeekOrigin.Begin);
            var result = await this.serializer.ReadClientMessage(fieldsStream, CancellationToken.None);

            Assert.AreEqual(message, result);
        }
        public void TestSerializationWithIBDateTimeNull()
        {
            var stream = new MemoryStream();
            var fieldsStream = new FieldsStream(stream);
            var message = new MessageWithIBDateTime {Field = null};

            this.serializer.Write(message, fieldsStream, CancellationToken.None);

            var result = new byte[6];
            stream.Seek(0, SeekOrigin.Begin);
            stream.Read(result, 0, result.Length);

            Assert.AreEqual(result.Length, stream.Length);

            var expected = Encoding.ASCII.GetBytes(
                1009.ToString() + char.MinValue + char.MinValue);

            Assert.IsTrue(expected.SequenceEqual(result));
        }
 protected bool Equals(MessageWithIBDateTime other)
 {
     return this.Field.Equals(other.Field);
 }