Ejemplo n.º 1
0
        public async Task GetPageList_Test()
        {
            var expectedModel = new JsonResultModel <CategoryInfo>()
            {
                Rows      = new List <CategoryInfo>(),
                TotalRows = 10
            };

            _categoryRepository
            .Setup(x => x.Query(It.IsAny <GridParams>(), It.IsAny <Expression <Func <CategoryInfo, bool> > >()))
            .ReturnsAsync(() => expectedModel);
            var actualModel = await _categoryBusiness.GetPageList(new CategorySearchRequest());

            var actualStr   = JsonConvert.SerializeObject(actualModel);
            var expectedStr = JsonConvert.SerializeObject(expectedModel);

            Assert.Equal(expectedStr, actualStr);
        }