Constants.swift 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. import Foundation
  15. /// String constants used for testing.
  16. enum Constants {
  17. static let key1 = "Key1"
  18. static let jedi = "Jedi"
  19. static let sith = "Sith_Lord"
  20. static let value1 = "Value1"
  21. static let obiwan = "Obi-Wan"
  22. static let yoda = "Yoda"
  23. static let darthSidious = "Darth Sidious"
  24. static let stringKey = "myString"
  25. static let stringValue = "string contents"
  26. static let intKey = "myInt"
  27. static let intValue: Int = 123
  28. static let floatKey = "myFloat"
  29. static let floatValue: Float = 42.75
  30. static let doubleValue: Double = 42.75
  31. static let decimalKey = "myDecimal"
  32. static let decimalValue: Decimal = 375.785
  33. static let trueKey = "myTrue"
  34. static let falseKey = "myFalse"
  35. static let dataKey = "myData"
  36. static let dataValue: Data = "data".data(using: .utf8)!
  37. static let arrayKey = "fruits"
  38. static let arrayValue: [String] = ["mango", "pineapple", "papaya"]
  39. static let dictKey = "platforms"
  40. static let dictValue: [String: String] = [
  41. "iOS": "14.0", "macOS": "14.0", "tvOS": "10.0", "watchOS": "6.0",
  42. ]
  43. static let jsonKey = "Recipe"
  44. static let jsonValue: [String: AnyHashable] = [
  45. "recipeName": "PB&J",
  46. "ingredients": ["bread", "peanut butter", "jelly"],
  47. "cookTime": 7,
  48. ]
  49. static let nonJsonKey = "notJSON"
  50. static let nonJsonValue = "notJSON"
  51. }