Beispiel #1
0
        public async Task Update_Test(CategoryInfo categoryInfo, bool isExist, ResultModel <string> expectedModel)
        {
            _categoryRepository
            .Setup(x => x.AnyAsync(It.IsAny <Expression <Func <CategoryInfo, bool> > >())).ReturnsAsync(isExist);
            _categoryRepository.Setup(x => x.UpdateAsync(It.IsAny <CategoryInfo>())).ReturnsAsync(true);
            var actualModel = await _categoryBusiness.UpdateAsync(categoryInfo);

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

            Assert.Equal(expectedStr, actualStr);
        }