public void Delete() { var users = _userRepository.GetAll(); foreach (var user in users) { _userRepository.Delete(user.Id); var deletedUser = _userRepository.GetById(user.Id); Assert.IsNull(deletedUser); } }
public async Task TestDelete(string id) { var repository = new MongoDBRepository(); await repository.Delete<BaseEntity>(Guid.Parse(id)); Assert.Throws(typeof(AggregateException), delegate { var entity = repository.Get<BaseEntity>(Guid.Parse(id)).Result; }); }