예제 #1
0
        public async void DeleteOptionByProductIdAndOptionIdAsync_ShouldReturnOption()
        {
            // Arrange
            var expectedResult = new ProductOption()
            {
                Name = "option name"
            };
            var productId = Guid.NewGuid();

            OptionRepositoryMock.Setup(x => x.DeleteOptionByProductIdAndOptionIdAsync(productId, expectedResult.Id)).ReturnsAsync(expectedResult);

            // Act
            var result = await ServiceTest.DeleteOptionByProductIdAndOptionIdAsync(productId, expectedResult.Id);

            // Assert
            Assert.Equal(expectedResult, result);
        }