File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
FirebaseRemoteConfigSwift/Sources
FirebaseRemoteConfig/Tests/SwiftAPI Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,10 @@ private enum Constants {
76
76
XCTAssertEqual ( config [ Constants . floatKey] . numberValue. doubleValue, Constants . doubleValue)
77
77
XCTAssertEqual ( config [ Constants . trueKey] . boolValue, true )
78
78
XCTAssertEqual ( config [ Constants . falseKey] . boolValue, false )
79
+ XCTAssertEqual (
80
+ config [ Constants . stringKey] . dataValue,
81
+ Constants . stringValue. data ( using: . utf8)
82
+ )
79
83
XCTAssertEqual (
80
84
config [ Constants . jsonKey] . jsonValue as! [ String : AnyHashable ] ,
81
85
Constants . jsonValue
@@ -101,6 +105,10 @@ private enum Constants {
101
105
XCTAssertEqual ( config [ doubleValue: Constants . floatKey] , Constants . doubleValue)
102
106
XCTAssertEqual ( config [ boolValue: Constants . trueKey] , true )
103
107
XCTAssertEqual ( config [ boolValue: Constants . falseKey] , false )
108
+ XCTAssertEqual (
109
+ config [ dataValue: Constants . stringKey] ,
110
+ Constants . stringValue. data ( using: . utf8)
111
+ )
104
112
XCTAssertEqual ( try XCTUnwrap ( config [ jsonValue: Constants . jsonKey] ) , Constants . jsonValue)
105
113
}
106
114
Original file line number Diff line number Diff line change @@ -86,6 +86,10 @@ public extension RemoteConfig {
86
86
return configValue ( forKey: key) . boolValue
87
87
}
88
88
89
+ subscript( dataValue key: String ) -> Data {
90
+ return configValue ( forKey: key) . dataValue
91
+ }
92
+
89
93
subscript( jsonValue key: String ) -> [ String : AnyHashable ] ? {
90
94
guard let value = configValue ( forKey: key) . jsonValue as? [ String : AnyHashable ] else {
91
95
// nil is the historical behavior for failing to extract JSON.
You can’t perform that action at this time.
0 commit comments