public async Task TestDeserializationWithIBBoolFalse() { var stream = new MemoryStream(); var fieldsStream = new FieldsStream(stream); var message = new MessageWithIBBool {Field = false}; 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); }
private bool Equals(MessageWithIBBool other) { return this.Field.Equals(other.Field); }
public void TestSerializationWithIBBoolFalse() { var stream = new MemoryStream(); var fieldsStream = new FieldsStream(stream); var message = new MessageWithIBBool {Field = false}; this.serializer.Write(message, fieldsStream, CancellationToken.None); var result = new byte[7]; stream.Seek(0, SeekOrigin.Begin); stream.Read(result, 0, result.Length); Assert.AreEqual(result.Length, stream.Length); var expected = Encoding.ASCII.GetBytes( 1008.ToString() + char.MinValue + "0" + char.MinValue); Assert.IsTrue(expected.SequenceEqual(result)); }