예제 #1
0
        public void Remove_AnyId_DeleteOneCalled()
        {
            string id = "AnyId";

            _repository.Remove(id);

            A.CallTo(() => _collection.DeleteOne(A <Expression <Func <AnyModel, bool> > > .Ignored)).MustHaveHappenedOnceExactly();
        }
예제 #2
0
        public void Remove(string id)
        {
            if (id == null)
            {
                throw new ArgumentNullException($"{nameof(id)} cannot be null");
            }

            Collection.DeleteOne(d => d.Id == id);
        }