Exemplo n.º 1
0
        public void WritesIntegers(long value, byte[] encoding)
        {
            var stream = new MemoryStream();

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

            Assert.Equal(encoding, stream.ToArray());
        }
Exemplo n.º 2
0
        public void WritesIntegers(long value, byte[] encoding)
        {
            var stream = new MemoryStream();

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

            using (stream)
            {
                write(stream);
            }

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