Esempio n. 1
0
        public void Update(string id, TModel data)
        {
            if (id == null)
            {
                throw new ArgumentNullException($"{nameof(id)} cannot be null");
            }

            Collection.ReplaceOne(d => d.Id == id, data);
        }
Esempio n. 2
0
        public void Update_Any_ReplaceOneCalled()
        {
            string id    = "AnyId";
            var    model = new AnyModel
            {
                AnyString = "AnyString"
            };

            _repository.Update(id, model);

            A.CallTo(() => _collection.ReplaceOne(A <Expression <Func <AnyModel, bool> > > .Ignored, model)).MustHaveHappenedOnceExactly();
        }