public void GetValueShouldReturnTheValueFromAPath()
        {
            var input = new HostTestFixture() {
                Child = new TestFixture() {IsNotNullString = "Foo"},
            };

            Expression<Func<HostTestFixture, string>> expression = x => x.Child.IsNotNullString;
            var fixture = new ObservedChange<HostTestFixture, string>(input, expression.Body);

            Assert.Equal("Foo", fixture.GetValue());
        }
        public void SetValuePathSmokeTest()
        {
            var output = new HostTestFixture() {
                Child = new TestFixture() {IsNotNullString = "Foo"},
            };

            Expression<Func<TestFixture, string>> expression = x => x.IsOnlyOneWord;
            var fixture = new ObservedChange<TestFixture, string>(new TestFixture() { IsOnlyOneWord = "Bar" }, expression.Body);

            fixture.SetValueToProperty(output, x => x.Child.IsNotNullString);
            Assert.Equal("Bar", output.Child.IsNotNullString);
        }
        public void GetValueShouldReturnTheValueFromAPath()
        {
            var input = new HostTestFixture()
            {
                Child = new TestFixture()
                {
                    IsNotNullString = "Foo"
                },
            };

            Expression <Func <HostTestFixture, string> > expression = x => x.Child.IsNotNullString;
            var fixture = new ObservedChange <HostTestFixture, string>(input, expression.Body);

            Assert.Equal("Foo", fixture.GetValue());
        }
Пример #4
0
        public void SetValuePathSmokeTest()
        {
            var output = new HostTestFixture
            {
                Child = new TestFixture {
                    IsNotNullString = "Foo"
                },
            };

            Expression <Func <TestFixture, string> > expression = x => x.IsOnlyOneWord;
            var fixture = new ObservedChange <TestFixture, string>(new TestFixture {
                IsOnlyOneWord = "Bar"
            }, expression.Body);

            fixture.SetValueToProperty(output, x => x.Child.IsNotNullString);
            Assert.Equal("Bar", output.Child.IsNotNullString);
        }
        public void GetValueShouldReturnTheValueFromAPath()
        {
            var input = new HostTestFixture()
            {
                Child = new TestFixture()
                {
                    IsNotNullString = "Foo"
                },
            };

            var fixture = new ObservedChange <HostTestFixture, string>()
            {
                Sender       = input,
                PropertyName = "Child.IsNotNullString",
                Value        = null,
            };

            Assert.Equal("Foo", fixture.GetValue());
        }
        public void SetValuePathSmokeTest()
        {
            var output = new HostTestFixture()
            {
                Child = new TestFixture()
                {
                    IsNotNullString = "Foo"
                },
            };

            var fixture = new ObservedChange <TestFixture, string>()
            {
                Sender = new TestFixture()
                {
                    IsOnlyOneWord = "Bar"
                },
                PropertyName = "IsOnlyOneWord",
                Value        = null,
            };

            fixture.SetValueToProperty(output, x => x.Child.IsNotNullString);
            Assert.Equal("Bar", output.Child.IsNotNullString);
        }
        public void SetValuePathSmokeTest()
        {
            var output = new HostTestFixture() {
                Child = new TestFixture() {IsNotNullString = "Foo"},
            };

            var fixture = new ObservedChange<TestFixture, string>() {
                Sender = new TestFixture() { IsOnlyOneWord = "Bar" },
                PropertyName = "IsOnlyOneWord",
                Value = null,
            };

            fixture.SetValueToProperty(output, x => x.Child.IsNotNullString);
            Assert.Equal("Bar", output.Child.IsNotNullString);
        }
        public void GetValueShouldReturnTheValueFromAPath()
        {
            var input = new HostTestFixture() {
                Child = new TestFixture() {IsNotNullString = "Foo"},
            };

            var fixture = new ObservedChange<HostTestFixture, string>() {
                Sender = input,
                PropertyName = "Child.IsNotNullString",
                Value = null,
            };

            Assert.Equal("Foo", fixture.GetValue());
        }