Esempio n. 1
0
        public async Task AddCategoryToShopTestAsync()
        {
            // Arrange
            Mock <ShopCategory>         mockShopCategory         = new Mock <ShopCategory>();
            Mock <AddCategoryToShopDto> mockAddCategoryToShopDto = new Mock <AddCategoryToShopDto>();
            ShopController controller = new ShopController(mockShopService.Object);

            // Act
            var result = await controller.AddCategoryToShop(mockAddCategoryToShopDto.Object);

            var okResult = Assert.IsType <OkObjectResult>(result);

            // Assert
            Assert.IsType <OkObjectResult>(result);
            mockShopService.Verify(
                mock => mock.AddCategoryToShop(mockShopCategory.Object), Times.Never());
        }