MockApplicationInfo.swift 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // Copyright 2022 Google LLC
  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. import Foundation
  16. @_implementationOnly import GoogleUtilities
  17. @testable import FirebaseSessions
  18. class MockApplicationInfo: ApplicationInfoProtocol {
  19. var appID: String = ""
  20. var bundleID: String = ""
  21. var sdkVersion: String = ""
  22. var osName: String = ""
  23. var deviceModel: String = ""
  24. var mccMNC: String = ""
  25. var environment: DevEnvironment = .prod
  26. var appBuildVersion: String = ""
  27. var appDisplayVersion: String = ""
  28. var networkInfo: NetworkInfoProtocol = MockNetworkInfo()
  29. static let testAppID = "testAppID"
  30. static let testBundleID = "testBundleID"
  31. static let testSDKVersion = "testSDKVersion"
  32. static let testOSName = "ios"
  33. static let testMCCMNC = "testMCCMNC"
  34. static let testDeviceModel = "testDeviceModel"
  35. static let testEnvironment: DevEnvironment = .prod
  36. static let testAppBuildVersion = "testAppBuildVersion"
  37. static let testAppDisplayVersion = "testAppDisplayVersion"
  38. static let testNetworkType = GULNetworkType.WIFI
  39. static let testMobileSubtype = "random"
  40. func mockAllInfo() {
  41. appID = MockApplicationInfo.testAppID
  42. bundleID = MockApplicationInfo.testBundleID
  43. sdkVersion = MockApplicationInfo.testSDKVersion
  44. osName = MockApplicationInfo.testOSName
  45. mccMNC = MockApplicationInfo.testMCCMNC
  46. deviceModel = MockApplicationInfo.testDeviceModel
  47. environment = MockApplicationInfo.testEnvironment
  48. appBuildVersion = MockApplicationInfo.testAppBuildVersion
  49. appDisplayVersion = MockApplicationInfo.testAppDisplayVersion
  50. }
  51. }