MockApplicationInfo.swift 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. #if SWIFT_PACKAGE
  17. internal import GoogleUtilities_Environment
  18. #else
  19. internal import GoogleUtilities
  20. #endif // SWIFT_PACKAGE
  21. @testable import FirebaseSessions
  22. class MockApplicationInfo: ApplicationInfoProtocol, @unchecked Sendable {
  23. var appID: String = ""
  24. var bundleID: String = ""
  25. var sdkVersion: String = ""
  26. var osName: String = ""
  27. var deviceModel: String = ""
  28. var environment: DevEnvironment = .prod
  29. var appBuildVersion: String = ""
  30. var appDisplayVersion: String = ""
  31. var osBuildVersion: String = ""
  32. var osDisplayVersion: String = ""
  33. var networkInfo: NetworkInfoProtocol = MockNetworkInfo()
  34. static let testAppID = "testAppID"
  35. static let testBundleID = "testBundleID"
  36. static let testSDKVersion = "testSDKVersion"
  37. static let testOSName = "ios"
  38. static let testDeviceModel = "testDeviceModel"
  39. static let testEnvironment: DevEnvironment = .prod
  40. static let testAppBuildVersion = "testAppBuildVersion"
  41. static let testAppDisplayVersion = "testAppDisplayVersion"
  42. static let testOsBuildVersion = "testOsBuildVersion"
  43. static let testOsDisplayVersion = "testOsDisplayVersion"
  44. static let testNetworkType = GULNetworkType.WIFI
  45. static let testMobileSubtype = "random"
  46. init() {
  47. appID = MockApplicationInfo.testAppID
  48. bundleID = MockApplicationInfo.testBundleID
  49. sdkVersion = MockApplicationInfo.testSDKVersion
  50. osName = MockApplicationInfo.testOSName
  51. deviceModel = MockApplicationInfo.testDeviceModel
  52. environment = MockApplicationInfo.testEnvironment
  53. appBuildVersion = MockApplicationInfo.testAppBuildVersion
  54. appDisplayVersion = MockApplicationInfo.testAppDisplayVersion
  55. osBuildVersion = MockApplicationInfo.testOsBuildVersion
  56. osDisplayVersion = MockApplicationInfo.testOsDisplayVersion
  57. }
  58. }