Skip to content

Commit

Permalink
Isolate unit tests more definitively
Browse files Browse the repository at this point in the history
(test improvement only; no production-side changes)
  • Loading branch information
reisenberger committed Nov 8, 2017
1 parent d7191ed commit b956846
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void Get_should_return_instance_previously_stored_in_cache()
MemoryCacheImplementation memoryCache = System.Runtime.Caching.MemoryCache.Default;
#endif

string key = "anything";
string key = Guid.NewGuid().ToString();
object value = new object();
#if PORTABLE
using (Microsoft.Extensions.Caching.Memory.ICacheEntry entry = memoryCache.CreateEntry(key)) {
Expand Down Expand Up @@ -96,7 +96,7 @@ public void Put_should_put_item_into_configured_MemoryCacheImplementation()
MemoryCacheImplementation memoryCache = System.Runtime.Caching.MemoryCache.Default;
#endif

string key = "anything";
string key = Guid.NewGuid().ToString();
object value = new object();

MemoryCacheProvider provider = new MemoryCacheProvider(memoryCache);
Expand Down Expand Up @@ -124,7 +124,7 @@ public void Put_should_put_item_using_passed_nonsliding_ttl()

TimeSpan shimTimeSpan = TimeSpan.FromSeconds(0.1); // If test fails transiently in different environments, consider increasing shimTimeSpan.

string key = "anything";
string key = Guid.NewGuid().ToString();
object value = new object();

MemoryCacheProvider provider = new MemoryCacheProvider(memoryCache);
Expand Down Expand Up @@ -164,7 +164,7 @@ public void Put_should_put_item_using_passed_sliding_ttl()

TimeSpan shimTimeSpan = TimeSpan.FromSeconds(1); // If test fails transiently in different environments, consider increasing shimTimeSpan.

string key = "anything";
string key = Guid.NewGuid().ToString();
object value = new object();

// Place an item in the cache that should last for only 2x shimTimespan
Expand Down

0 comments on commit b956846

Please sign in to comment.