Example #1
0
        public async Task GetAllAdminUserAsyncTest()
        {
            _mock.Setup(p => p.GetAllAsync(1, 10, null)).ReturnsAsync(new PageContainer <AdminUserEditDto>());
            var controller   = new AdminUserController(_mock.Object);
            var actionResult = await controller.GetAllAsync(1, 10, null);

            var contentResult = actionResult as OkNegotiatedContentResult <BaseApiResponse>;

            Assert.IsNotNull(actionResult);
            Assert.IsInstanceOfType(actionResult, typeof(IHttpActionResult));
            Assert.IsNotNull(contentResult);
            Assert.IsInstanceOfType(contentResult, typeof(OkNegotiatedContentResult <BaseApiResponse>));
            Assert.IsNotNull(contentResult.Content);
            Assert.IsInstanceOfType(contentResult.Content.Data, typeof(PageContainer <AdminUserEditDto>));
        }