예제 #1
0
        public static void IsNullOrEmpty_Null()
        {
            // Arrange
            IPagedList <int> list = null;

            // Act
            var result = PagedListHelper.IsNullOrEmpty(list);

            // Assert
            Assert.Null(list);
            Assert.True(result);
        }
예제 #2
0
        public static void IsNullOrEmpty_NotEmpty()
        {
            // Arrange
            var mockList = new Mock <IPagedList <int> >();

            mockList.SetupGet(list => list.State.HasItems).Returns(true);

            // Act
            var result = PagedListHelper.IsNullOrEmpty(mockList.Object);

            // Assert
            Assert.False(result);
        }
예제 #3
0
 public static bool IsNullOrEmpty <T>(this IPagedList <T> pagedList)
 {
     return(PagedListHelper.IsNullOrEmpty(pagedList));
 }