Ejemplo n.º 1
0
        public void HandlesConstantUInt16Expression()
        {
            // arrange
            var value      = ushort.MaxValue;
            var input      = Expression.Constant(value);
            var serializer = new Expresso();

            // act
            using var stream = new MemoryStream();
            serializer.Serialize(stream, input);
            stream.Position = 0;
            var output = serializer.Deserialize(stream);

            // assert
            Assert.NotNull(output);
            var constant = Assert.IsType <ConstantExpression>(output);
            var result   = Assert.IsType <ushort>(constant.Value);

            Assert.Equal(value, result);
        }