Constants.swift 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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] = ["iOS": "14.0", "macOS": "14.0", "tvOS": "10.0", "watchOS": "6.0"]
  41. static let jsonKey = "Recipe"
  42. static let jsonValue: [String: AnyHashable] = ["recipeName": "PB&J",
  43. "ingredients": ["bread", "peanut butter", "jelly"],
  44. "cookTime": 7]
  45. static let nonJsonKey = "notJSON"
  46. static let nonJsonValue = "notJSON"
  47. }