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()); }
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()); }