PhotosRightsHelperMock.swift 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // _____ _
  2. // |_ _| |_ _ _ ___ ___ _ __ __ _
  3. // | | | ' \| '_/ -_) -_) ' \/ _` |_
  4. // |_| |_||_|_| \___\___|_|_|_\__,_(_)
  5. //
  6. // Threema iOS Client
  7. // Copyright (c) 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. class PhotosRightsHelperMock : PhotosRightsHelperProtocol {
  22. private var accessLevelDeterminedResult : Bool
  23. private var requestWriteAccessResult : Bool
  24. private var requestReadAccessResult : Bool
  25. private var readAccess : Bool
  26. private var fullAccess : Bool
  27. private var writeAccess : Bool
  28. private var newPhotosApi : Bool
  29. init(accessLevelDetermined : Bool, requestWriteAccess : Bool, requestReadAccess : Bool, readAccess : Bool, fullAccess : Bool, writeAccess : Bool, newPhotosApi : Bool) {
  30. self.accessLevelDeterminedResult = accessLevelDetermined
  31. self.writeAccess = writeAccess
  32. self.readAccess = readAccess
  33. self.fullAccess = fullAccess
  34. self.requestWriteAccessResult = requestWriteAccess
  35. self.requestReadAccessResult = requestReadAccess
  36. self.newPhotosApi = newPhotosApi
  37. }
  38. func accessLevelDetermined() -> Bool {
  39. return accessLevelDeterminedResult
  40. }
  41. func requestWriteAccess() -> Bool {
  42. return requestWriteAccessResult
  43. }
  44. func requestReadAccess() -> Bool {
  45. return requestReadAccessResult
  46. }
  47. func haveFullAccess() -> Bool {
  48. return fullAccess
  49. }
  50. func haveWriteAccess() -> Bool {
  51. return writeAccess
  52. }
  53. func checknewPhotosApi() -> Bool {
  54. return newPhotosApi
  55. }
  56. }