예제 #1
0
        public void Property_NotNullArgument_ShouldReturnCalledProperty()
        {
            //Arrange
            Expression <Func <DateTime, object> > propertyExpression = x => x.Day;
            var property = typeof(DateTime).GetProperty("Day");

            Assert.That(ExpressionReflection.Property(propertyExpression), Is.EqualTo(property));
        }
        private static TableParameters CreateRequestForPage(int pageNumber)
        {
            var requestParameters = new TableParameters(
                new PagingParameters(pageNumber, PageSize),
                new OrderingParameters(ExpressionReflection.Property <ComponentInterface>(x => x.Name).Name, SortDirection.Descending));

            return(requestParameters);
        }
예제 #3
0
 public void Property_NullArgument_ShouldThrowArgumentNullException()
 {
     Assert.That(() => ExpressionReflection.Property <DateTime>(null),
                 Throws.InstanceOf <ArgumentNullException>());
 }