public async Task InsertProduct_NullArgument_ThrowException() { var request = new UpdateProductReviewTotalsCommand(); await Assert.ThrowsExceptionAsync <ArgumentNullException>( async() => await _updateProductReviewTotalsCommandHandler.Handle(request, default)); }
public async Task UpdateProductReviews_ValidArgument_InvokeRepositoryAndCache() { var request = new UpdateProductReviewTotalsCommand { Product = new Product() }; await _updateProductReviewTotalsCommandHandler.Handle(request, default); _productReviewServiceMock.Verify(x => x.GetAllProductReviews(null, null, null, null, null, null, It.IsAny <string>(), 0, It.IsAny <int>()), Times.Once); _productRepositoryMock.Verify(x => x.Collection.UpdateOneAsync(It.IsAny <FilterDefinition <Product> >(), It.IsAny <UpdateDefinition <Product> >(), It.IsAny <UpdateOptions>(), default), Times.Once); }