public async Task UpdatePackagesAsync_Most_Return_BadRequest() { mockPackageHandler.Setup(x => x.UpdatePackagesAsync(null)); var controller = new PackagesController(mockPackageQueryHandler.Object, mockPackageHandler.Object); var result = await controller.UpdatePackagesAsync(null) as BadRequestResult; Assert.NotNull(result); Assert.Equal(400, result.StatusCode); mockPackageQueryHandler.VerifyAll(); }
public async Task UpdatePackagesAsync_Most_Return_OkResult() { var commandList = new List <UpdatePackageCommand> { new UpdatePackageCommand() }; mockPackageHandler.Setup(x => x.UpdatePackagesAsync(commandList)); var controller = new PackagesController(mockPackageQueryHandler.Object, mockPackageHandler.Object); var result = await controller.UpdatePackagesAsync(commandList) as OkResult; Assert.NotNull(result); Assert.Equal(200, result.StatusCode); mockPackageQueryHandler.VerifyAll(); }