Esempio n. 1
0
        public async Task AddProductPart_Success()
        {
            //Arrange
            var addProductPartDto = new AddProductPartDto {
                Reference = reference, PartId = partId
            };

            //Act
            var action = await warehouseController.AddProductPart(addProductPartDto) as RedirectToActionResult;

            //Assert
            warehouseService.Verify(x => x.AddProductPart(reference, partId), Times.Once);
            Assert.Equal("UpdateProduct", action.ActionName);
            Assert.Equal("Product", action.ControllerName);
        }