public void Remove_AnyId_DeleteOneCalled() { string id = "AnyId"; _repository.Remove(id); A.CallTo(() => _collection.DeleteOne(A <Expression <Func <AnyModel, bool> > > .Ignored)).MustHaveHappenedOnceExactly(); }
public void Remove(string id) { if (id == null) { throw new ArgumentNullException($"{nameof(id)} cannot be null"); } Collection.DeleteOne(d => d.Id == id); }