Exemple #1
0
        public async Task InsertPackagesAsync_Most_Return_BadRequest()
        {
            mockPackageHandler.Setup(x => x.InsertPackagesAsync(null));

            var controller = new PackagesController(mockPackageQueryHandler.Object, mockPackageHandler.Object);

            var result = await controller.InsertPackagesAsync(null) as BadRequestResult;

            Assert.NotNull(result);
            Assert.Equal(400, result.StatusCode);

            mockPackageQueryHandler.VerifyAll();
        }
Exemple #2
0
        public async Task InsertPackagesAsync_Most_Return_OkObjectResult()
        {
            var commandList = new List <InsertPackageCommand>
            {
                new InsertPackageCommand()
            };

            mockPackageHandler.Setup(x => x.InsertPackagesAsync(commandList));

            var controller = new PackagesController(mockPackageQueryHandler.Object, mockPackageHandler.Object);

            var result = await controller.InsertPackagesAsync(commandList) as OkObjectResult;

            Assert.NotNull(result);
            Assert.Equal(200, result.StatusCode);

            mockPackageQueryHandler.VerifyAll();
        }