예제 #1
0
        public void FunctionCall <T>(T value)
        {
            var vh     = new ReadWriteValueHolder <T>(value);
            var exp    = CreateExpression(() => vh.GetValue());
            var binder = ValueBinder.Create(exp);

            binder.CanSetValue.Should().BeFalse();
            binder.ValueLabel.Should().Be(nameof(vh.GetValue));
            binder.TargetType.Should().Be(typeof(T));
        }
예제 #2
0
        public void ReadWritePropertyWithUnary()
        {
            var vh     = new ReadWriteValueHolder <int>(42);
            var exp    = CreateExpression(() => - vh.Value);
            var binder = ValueBinder.Create(exp);

            binder.CanSetValue.Should().BeTrue();
            binder.ValueLabel.Should().Be(nameof(vh.Value));
            binder.TargetType.Should().Be(vh.GetType());
        }