Exemple #1
0
        public void CreateProductOptionCommandHandlerShouldCallCommit()
        {
            // Arrange
            _productOptionRepository.Setup(e => e.Add(It.IsAny <ProductOption>()));

            // Act
            var commandHandler = new ProductOptionCommandHandler(_uow.Object, _productOptionRepository.Object);

            commandHandler.Handle(new CreateProductOptionCommand(Guid.NewGuid(), "name", "desc"));

            // Assert
            _uow.Verify(o => o.Commit(), Times.Once());
        }
Exemple #2
0
        public void DeleteProductOptionCommandHandlerShouldCallCommit()
        {
            // Arrange
            _productOptionRepository.Setup(e => e.Remove(It.IsAny <Guid>()));

            // Act
            var commandHandler = new ProductOptionCommandHandler(_uow.Object, _productOptionRepository.Object);

            commandHandler.Handle(new DeleteProductOptionCommand(Guid.NewGuid()));

            // Assert
            _uow.Verify(o => o.Commit(), Times.Once());
        }