示例#1
0
        public async Task ActiveBrandAsync_Return_NoContent_Result(Mock <IUserService> userService)
        {
            // Arrange
            var sut = new AccountController(userService.Object);

            sut.ControllerContext = new ControllerContext
            {
                HttpContext = new DefaultHttpContext()
            };
            userService.Setup(setup => setup.ActiveUserAsync(userId));

            // Act
            var result = sut.ActiveUserAsync(userId);


            // Assert
            Assert.IsType <NoContentResult>(result.Result);
            Assert.IsNotType <OkObjectResult>(result.Result);
            Assert.IsNotType <CreatedAtActionResult>(result.Result);
            Assert.IsNotType <BadRequestObjectResult>(result.Result);
            Assert.IsNotType <AcceptedAtActionResult>(result.Result);
        }