public void WritesBooleans(bool value, byte[] encoding)
        {
            var stream = new MemoryStream();

            using (stream)
            {
                Codec.WriteBoolean(value, stream);
            }

            Assert.Equal(encoding, stream.ToArray());
        }
Exemple #2
0
        public void WritesBooleans(bool value, byte[] encoding)
        {
            var stream = new MemoryStream();

            var output = Expression.Parameter(typeof(Stream));
            var write  = (Action <Stream>)Expression.Lambda(Codec.WriteBoolean(Expression.Constant(value), output), new[] { output }).Compile();

            using (stream)
            {
                write(stream);
            }

            Assert.Equal(encoding, stream.ToArray());
        }