public void T06_Boolean_Buffered_IO() { var buffer = new byte[3]; foreach (var i in new bool[] { true, false }) { var x = new X690.Boolean(i); var length = x.Write(buffer, 0); TT.Peek(x, buffer, length); var y = (X690.Read(buffer, 0, length)) as X690.Boolean; Assert.Equal(x, y); Assert.Equal(y.Header.MessageLength, length); Assert.Equal(i, x.Value); Assert.Equal(i, y.Value); } }
public void T05_Boolean_Stream_IO() { foreach (var i in new bool[] { true, false }) { using (var stream = new MemoryStream()) { var x = new X690.Boolean(i); x.Write(stream); TT.Peek(x, stream); stream.Position = 0; var y = (X690.Read(stream)) as X690.Boolean; Assert.Equal(x, y); Assert.Equal(i, x.Value); Assert.Equal(i, y.Value); } } }