GDTCORStorageFake.m 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright 2019 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import "GDTCORTests/Common/Fakes/GDTCORStorageFake.h"
  17. @implementation GDTCORStorageFake
  18. - (void)storeEvent:(GDTCOREvent *)event
  19. onComplete:(void (^_Nullable)(BOOL wasWritten, NSError *_Nullable))completion {
  20. if (completion) {
  21. completion(YES, nil);
  22. }
  23. }
  24. - (void)removeEvents:(NSSet<NSNumber *> *)eventIDs {
  25. }
  26. - (void)libraryDataForKey:(nonnull NSString *)key
  27. onComplete:
  28. (nonnull void (^)(NSData *_Nullable, NSError *_Nullable error))onComplete {
  29. if (onComplete) {
  30. onComplete(nil, nil);
  31. }
  32. }
  33. - (void)storeLibraryData:(NSData *)data
  34. forKey:(nonnull NSString *)key
  35. onComplete:(nonnull void (^)(NSError *_Nullable error))onComplete {
  36. if (onComplete) {
  37. onComplete(nil);
  38. }
  39. }
  40. - (void)removeLibraryDataForKey:(nonnull NSString *)key
  41. onComplete:(nonnull void (^)(NSError *_Nullable))onComplete {
  42. if (onComplete) {
  43. onComplete(nil);
  44. }
  45. }
  46. @end