SafeConfigManagerMock.swift 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. // _____ _
  2. // |_ _| |_ _ _ ___ ___ _ __ __ _
  3. // | | | ' \| '_/ -_) -_) ' \/ _` |_
  4. // |_| |_||_|_| \___\___|_|_|_\__,_(_)
  5. //
  6. // Threema iOS Client
  7. // Copyright (c) 2019-2020 Threema GmbH
  8. //
  9. // This program is free software: you can redistribute it and/or modify
  10. // it under the terms of the GNU Affero General Public License, version 3,
  11. // as published by the Free Software Foundation.
  12. //
  13. // This program is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. // GNU Affero General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Affero General Public License
  19. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. import Foundation
  21. @testable import Threema
  22. class SafeConfigManagerMock: NSObject, SafeConfigManagerProtocol {
  23. var safeConfigDestroyCallCount = 0
  24. private var server: String?
  25. init(server: String?) {
  26. self.server = server
  27. }
  28. func destroy() {
  29. safeConfigDestroyCallCount += 1
  30. }
  31. func getKey() -> [UInt8]? {
  32. return nil
  33. }
  34. func setKey(_ value: [UInt8]?) {
  35. }
  36. func getCustomServer() -> String? {
  37. return nil
  38. }
  39. func setCustomServer(_ value: String?) {
  40. }
  41. func getServer() -> String? {
  42. return self.server
  43. }
  44. func setServer(_ value: String?) {
  45. }
  46. func getMaxBackupBytes() -> Int? {
  47. return nil
  48. }
  49. func setMaxBackupBytes(_ value: Int?) {
  50. }
  51. func getRetentionDays() -> Int? {
  52. return nil
  53. }
  54. func setRetentionDays(_ value: Int?) {
  55. }
  56. func getBackupSize() -> Int64? {
  57. return nil
  58. }
  59. func setBackupSize(_ value: Int64?) {
  60. }
  61. func getBackupStartedAt() -> Date? {
  62. return nil
  63. }
  64. func setBackupStartedAt(_ value: Date?) {
  65. }
  66. func getLastBackup() -> Date? {
  67. return nil
  68. }
  69. func setLastBackup(_ value: Date?) {
  70. }
  71. func getLastResult() -> String? {
  72. return nil
  73. }
  74. func setLastResult(_ value: String?) {
  75. }
  76. func getLastChecksum() -> [UInt8]? {
  77. return nil
  78. }
  79. func setLastChecksum(_ value: [UInt8]?) {
  80. }
  81. public func getLastAlertBackupFailed() -> Date? {
  82. return nil
  83. }
  84. public func setLastAlertBackupFailed(_ value: Date?) {
  85. }
  86. func getIsTriggered() -> Bool {
  87. return false
  88. }
  89. func setIsTriggered(_ value: Bool) {
  90. }
  91. }