@@ -39,7 +39,7 @@ public void setUp() {
39
39
40
40
@ Test
41
41
public void getBoolean_valueIsNotSet_returnsEmpty () {
42
- deviceCacheManager .setContext (context );
42
+ deviceCacheManager .setContext (appContext );
43
43
fakeScheduledExecutorService .runAll ();
44
44
45
45
assertThat (deviceCacheManager .getBoolean ("some_key" ).isAvailable ()).isFalse ();
@@ -53,7 +53,7 @@ public void getBoolean_contextAndValueNotSet_returnsEmpty() {
53
53
54
54
@ Test
55
55
public void getBoolean_valueIsSet_returnsSetValue () {
56
- deviceCacheManager .setContext (context );
56
+ deviceCacheManager .setContext (appContext );
57
57
fakeScheduledExecutorService .runAll ();
58
58
deviceCacheManager .setValue ("some_key" , true );
59
59
@@ -62,7 +62,7 @@ public void getBoolean_valueIsSet_returnsSetValue() {
62
62
63
63
@ Test
64
64
public void clear_setBooleanThenCleared_returnsEmpty () {
65
- deviceCacheManager .setContext (context );
65
+ deviceCacheManager .setContext (appContext );
66
66
fakeScheduledExecutorService .runAll ();
67
67
deviceCacheManager .setValue ("some_key" , true );
68
68
@@ -85,7 +85,7 @@ public void getBoolean_firebaseAppNotExist_returnsEmpty() {
85
85
86
86
@ Test
87
87
public void setValueBoolean_setTwice_canGetLatestValue () {
88
- deviceCacheManager .setContext (context );
88
+ deviceCacheManager .setContext (appContext );
89
89
fakeScheduledExecutorService .runAll ();
90
90
deviceCacheManager .setValue ("some_key" , true );
91
91
assertThat (deviceCacheManager .getBoolean ("some_key" ).get ()).isTrue ();
@@ -108,7 +108,7 @@ public void setValueBoolean_keyIsNull_returnsFalse() {
108
108
109
109
@ Test
110
110
public void getString_valueIsNotSet_returnsEmpty () {
111
- deviceCacheManager .setContext (context );
111
+ deviceCacheManager .setContext (appContext );
112
112
fakeScheduledExecutorService .runAll ();
113
113
114
114
assertThat (deviceCacheManager .getString ("some_key" ).isAvailable ()).isFalse ();
@@ -121,7 +121,7 @@ public void getString_contextAndValueNotSet_returnsEmpty() {
121
121
122
122
@ Test
123
123
public void getString_valueIsSet_returnsSetValue () {
124
- deviceCacheManager .setContext (context );
124
+ deviceCacheManager .setContext (appContext );
125
125
fakeScheduledExecutorService .runAll ();
126
126
deviceCacheManager .setValue ("some_key" , "specialValue" );
127
127
@@ -140,7 +140,7 @@ public void getString_firebaseAppNotExist_returnsEmpty() {
140
140
141
141
@ Test
142
142
public void setValueString_setTwice_canGetLatestValue () {
143
- deviceCacheManager .setContext (context );
143
+ deviceCacheManager .setContext (appContext );
144
144
fakeScheduledExecutorService .runAll ();
145
145
deviceCacheManager .setValue ("some_key" , "EarliestValue" );
146
146
assertThat (deviceCacheManager .getString ("some_key" ).get ()).isEqualTo ("EarliestValue" );
@@ -157,22 +157,22 @@ public void setValueString_contextNotSet_returnsEmpty() {
157
157
158
158
@ Test
159
159
public void setValueString_setNullString_returnsEmpty () {
160
- deviceCacheManager .setContext (context );
160
+ deviceCacheManager .setContext (appContext );
161
161
fakeScheduledExecutorService .runAll ();
162
162
deviceCacheManager .setValue ("some_key" , null );
163
163
assertThat (deviceCacheManager .getString ("some_key" ).isAvailable ()).isFalse ();
164
164
}
165
165
166
166
@ Test
167
167
public void setValueString_keyIsNull_returnsFalse () {
168
- deviceCacheManager .setContext (context );
168
+ deviceCacheManager .setContext (appContext );
169
169
fakeScheduledExecutorService .runAll ();
170
170
assertThat (deviceCacheManager .setValue (null , "value" )).isFalse ();
171
171
}
172
172
173
173
@ Test
174
174
public void getFloat_valueIsNotSet_returnsEmpty () {
175
- deviceCacheManager .setContext (context );
175
+ deviceCacheManager .setContext (appContext );
176
176
fakeScheduledExecutorService .runAll ();
177
177
178
178
assertThat (deviceCacheManager .getFloat ("some_key" ).isAvailable ()).isFalse ();
@@ -189,7 +189,7 @@ public void getFloat_contextAndValueNotSet_returnsEmpty() {
189
189
190
190
@ Test
191
191
public void getFloat_valueIsSet_returnsSetValue () {
192
- deviceCacheManager .setContext (context );
192
+ deviceCacheManager .setContext (appContext );
193
193
fakeScheduledExecutorService .runAll ();
194
194
deviceCacheManager .setValue ("some_key" , 1.2f );
195
195
@@ -209,7 +209,7 @@ public void getFloat_firebaseAppNotExist_returnsEmpty() {
209
209
210
210
@ Test
211
211
public void setValueFloat_setTwice_canGetLatestValue () {
212
- deviceCacheManager .setContext (context );
212
+ deviceCacheManager .setContext (appContext );
213
213
fakeScheduledExecutorService .runAll ();
214
214
deviceCacheManager .setValue ("some_key" , 1.01f );
215
215
assertThat (deviceCacheManager .getFloat ("some_key" ).get ()).isEqualTo (1.01f );
@@ -226,7 +226,7 @@ public void setValueFloat_contextNotSet_returnsEmpty() {
226
226
227
227
@ Test
228
228
public void setValueFloat_keyIsNull_returnsFalse () {
229
- deviceCacheManager .setContext (context );
229
+ deviceCacheManager .setContext (appContext );
230
230
fakeScheduledExecutorService .runAll ();
231
231
assertThat (deviceCacheManager .setValue (null , 10.0f )).isFalse ();
232
232
}
@@ -235,7 +235,7 @@ public void setValueFloat_keyIsNull_returnsFalse() {
235
235
public void getLong_valueIsNotSet_returnsEmpty () {
236
236
DeviceCacheManager .clearInstance ();
237
237
deviceCacheManager = new DeviceCacheManager (fakeScheduledExecutorService );
238
- deviceCacheManager .setContext (context );
238
+ deviceCacheManager .setContext (appContext );
239
239
fakeScheduledExecutorService .runAll ();
240
240
241
241
assertThat (fakeScheduledExecutorService .isEmpty ()).isTrue ();
@@ -253,7 +253,7 @@ public void getLong_contextAndValueNotSet_returnsEmpty() {
253
253
254
254
@ Test
255
255
public void getLong_valueIsSet_returnsSetValue () {
256
- deviceCacheManager .setContext (context );
256
+ deviceCacheManager .setContext (appContext );
257
257
fakeScheduledExecutorService .runAll ();
258
258
deviceCacheManager .setValue ("some_key" , 1L );
259
259
@@ -272,7 +272,7 @@ public void getLong_firebaseAppNotExist_returnsEmpty() {
272
272
273
273
@ Test
274
274
public void setValueLong_setTwice_canGetLatestValue () {
275
- deviceCacheManager .setContext (context );
275
+ deviceCacheManager .setContext (appContext );
276
276
fakeScheduledExecutorService .runAll ();
277
277
deviceCacheManager .setValue ("some_key" , 2L );
278
278
assertThat (deviceCacheManager .getLong ("some_key" ).get ()).isEqualTo (2L );
@@ -290,7 +290,7 @@ public void setValueLong_contextNotSet_returnsEmpty() {
290
290
291
291
@ Test
292
292
public void setValueLong_keyIsNull_returnsFalse () {
293
- deviceCacheManager .setContext (context );
293
+ deviceCacheManager .setContext (appContext );
294
294
fakeScheduledExecutorService .runAll ();
295
295
assertThat (deviceCacheManager .setValue (null , 10.0f )).isFalse ();
296
296
}
0 commit comments