public Task UpdateAsync(string id, TModel data) { if (id == null) { throw new ArgumentNullException($"{nameof(id)} cannot be null"); } return(Collection.ReplaceOneAsync(d => d.Id == id, data)); }
public void UpdateAsync_Any_ReplaceOneAsyncCalled() { string id = "AnyId"; var model = new AnyModel { AnyString = "AnyString" }; _repository.UpdateAsync(id, model); A.CallTo(() => _collection.ReplaceOneAsync(A <Expression <Func <AnyModel, bool> > > .Ignored, model)).MustHaveHappenedOnceExactly(); }