示例#1
0
        public async Task DeleteJsonAsync_Should_Delete_User_Json_With_Same_IdAsync(string username, Guid jsonId)
        {
            Expression <Func <DbJson, bool> > expression = null;

            _mongoCollectionClient
            .When(x => x.DeleteOneAsync(username, Arg.Any <Expression <Func <DbJson, bool> > >()))
            .Do(info => { expression = (Expression <Func <DbJson, bool> >)info[1]; });

            await _jsonRepositoryInstance.DeleteJsonAsync(username, jsonId);

            Expression <Func <DbJson, bool> > expectedExpression = x => x.Id == jsonId;

            Assert.IsTrue(Lambda.Eq(expectedExpression, expression));
        }