Ejemplo n.º 1
0
        public void RemoveAsync_AnyId_DeleteOneAsyncCalled()
        {
            string id = "AnyId";

            _repository.RemoveAsync(id);

            A.CallTo(() => _collection.DeleteOneAsync(A <Expression <Func <AnyModel, bool> > > .Ignored)).MustHaveHappenedOnceExactly();
        }
Ejemplo n.º 2
0
        public Task RemoveAsync(string id)
        {
            if (id == null)
            {
                throw new ArgumentNullException($"{nameof(id)} cannot be null");
            }

            return(Collection.DeleteOneAsync(d => d.Id == id));
        }