コード例 #1
0
        public void GetTransformer()
        {
            var attribute = new LinqPropertyRedirectionAttribute(typeof(Order), "OrderNumber");

            var transformer = attribute.GetExpressionTransformer(null);

            Assert.That(transformer, Is.TypeOf(typeof(LinqPropertyRedirectionAttribute.MethodCallTransformer)));
            Assert.That(((LinqPropertyRedirectionAttribute.MethodCallTransformer)transformer).MappedProperty,
                        Is.SameAs(typeof(Order).GetProperty("OrderNumber")));
        }
コード例 #2
0
        public void GetTransformer_NonExistingProperty()
        {
            var attribute = new LinqPropertyRedirectionAttribute(typeof(Order), "Hugo");

            attribute.GetExpressionTransformer(null);
        }