예제 #1
0
        public void CreateValueLookup_returns_a_lambda_that_gets_the_property_value()
        {
            var propertyLookupLambda = SimpleDataLookup.CreateValueLookup ("foo bar");

            var dataSourceObject = new ClassWithHiddenProperties () {
                Year = 9001
            };

            Assert.AreEqual (dataSourceObject.Year, propertyLookupLambda (dataSourceObject));
        }
예제 #2
0
        public void CreateValueLookup_returns_a_lambda_that_returns_the_value_of_a_field()
        {
            var propertyLookupLambda = SimpleDataLookup.CreateValueLookup("Goo");

            var dataSourceObject = new ClassWithHiddenProperties();

            Assert.AreEqual (dataSourceObject.Goo, propertyLookupLambda(dataSourceObject));
        }
예제 #3
0
        public void CreateValueLookup_returns_a_lambda_that_returns_the_value_of_a_method()
        {
            var propertyLookupLambda = SimpleDataLookup.CreateValueLookup("SomeFunction");

            var dataSourceObject = new ClassWithHiddenProperties();

            Assert.AreEqual (dataSourceObject.SomeFunction(), propertyLookupLambda(dataSourceObject));
        }
예제 #4
0
        public void CreateValueLookup_returns_a_lambda_that_gets_the_submember_value()
        {
            var propertyLookupLambda = SimpleDataLookup.CreateValueLookup ("BoundByName");

            var dataSourceObject = new ClassWithHiddenProperties () {
                BoundByName = new ClassWithHiddenProperties() {
                    Title = "IT'S OVER 9000!"
                }
            };

            Assert.AreEqual (dataSourceObject.BoundByName.Title, propertyLookupLambda (dataSourceObject));
        }