@@ -218,38 +218,40 @@ public void AddSetReplaceTest()
218
218
{
219
219
log . Debug ( "Cache should be empty." ) ;
220
220
221
- Assert . True ( client . Store ( StoreMode . Set , "VALUE" , "1" ) , "Initialization failed" ) ;
221
+ var cacheKey = $ "{ nameof ( AddSetReplaceTest ) } -{ Guid . NewGuid ( ) } ";
222
+
223
+ Assert . True ( client . Store ( StoreMode . Set , cacheKey , "1" ) , "Initialization failed" ) ;
222
224
223
225
log . Debug ( "Setting VALUE to 1." ) ;
224
226
225
- Assert . Equal ( "1" , client . Get ( "VALUE" ) ) ;
227
+ Assert . Equal ( "1" , client . Get ( cacheKey ) ) ;
226
228
227
229
log . Debug ( "Adding VALUE; this should return false." ) ;
228
- Assert . False ( client . Store ( StoreMode . Add , "VALUE" , "2" ) , "Add should have failed" ) ;
230
+ Assert . False ( client . Store ( StoreMode . Add , cacheKey , "2" ) , "Add should have failed" ) ;
229
231
230
232
log . Debug ( "Checking if VALUE is still '1'." ) ;
231
- Assert . Equal ( "1" , client . Get ( "VALUE" ) ) ;
233
+ Assert . Equal ( "1" , client . Get ( cacheKey ) ) ;
232
234
233
235
log . Debug ( "Replacing VALUE; this should return true." ) ;
234
- Assert . True ( client . Store ( StoreMode . Replace , "VALUE" , "4" ) , "Replace failed" ) ;
236
+ Assert . True ( client . Store ( StoreMode . Replace , cacheKey , "4" ) , "Replace failed" ) ;
235
237
236
238
log . Debug ( "Checking if VALUE is '4' so it got replaced." ) ;
237
- Assert . Equal ( "4" , client . Get ( "VALUE" ) ) ;
239
+ Assert . Equal ( "4" , client . Get ( cacheKey ) ) ;
238
240
239
241
log . Debug ( "Removing VALUE." ) ;
240
- Assert . True ( client . Remove ( "VALUE" ) , "Remove failed" ) ;
242
+ Assert . True ( client . Remove ( cacheKey ) , "Remove failed" ) ;
241
243
242
244
log . Debug ( "Replacing VALUE; this should return false." ) ;
243
- Assert . False ( client . Store ( StoreMode . Replace , "VALUE" , "8" ) , "Replace should not have succeeded" ) ;
245
+ Assert . False ( client . Store ( StoreMode . Replace , cacheKey , "8" ) , "Replace should not have succeeded" ) ;
244
246
245
247
log . Debug ( "Checking if VALUE is 'null' so it was not replaced." ) ;
246
- Assert . Null ( client . Get ( "VALUE" ) ) ;
248
+ Assert . Null ( client . Get ( cacheKey ) ) ;
247
249
248
250
log . Debug ( "Adding VALUE; this should return true." ) ;
249
- Assert . True ( client . Store ( StoreMode . Add , "VALUE" , "16" ) , "Item should have been Added" ) ;
251
+ Assert . True ( client . Store ( StoreMode . Add , cacheKey , "16" ) , "Item should have been Added" ) ;
250
252
251
253
log . Debug ( "Checking if VALUE is '16' so it was added." ) ;
252
- Assert . Equal ( "16" , client . Get ( "VALUE" ) ) ;
254
+ Assert . Equal ( "16" , client . Get ( cacheKey ) ) ;
253
255
254
256
log . Debug ( "Passed AddSetReplaceTest." ) ;
255
257
}
0 commit comments