Skip to content

Commit f3e75ab

Browse files
committed
Chnaged ServicesTests to correspond to Dist cache lifetime (#247)
1 parent 3ed53cc commit f3e75ab

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

test/MyTested.AspNetCore.Mvc.Caching.Test/ServicesTests.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public void MockDistributedCacheShouldBeDifferentForEveryCallSynchronously()
258258
}
259259

260260
[Fact]
261-
public void MockDistributedCacheShouldBeDifferentForEveryCallSynchronouslyWithCachedControllerBuilder()
261+
public void MockDistributedCacheShouldBeSameForEveryCallSynchronouslyWithCachedControllerBuilder()
262262
{
263263
MyApplication
264264
.StartsFrom<DefaultStartup>()
@@ -277,7 +277,7 @@ public void MockDistributedCacheShouldBeDifferentForEveryCallSynchronouslyWithCa
277277
.WithDistributedCache(cache => cache.WithEntry(string.Empty, new byte[] { }))
278278
.Calling(c => c.DistributedCacheAction())
279279
.ShouldReturn()
280-
.BadRequest();
280+
.Ok();
281281

282282
MyApplication.StartsFrom<DefaultStartup>();
283283
}
@@ -329,7 +329,7 @@ public void ExplicitMockDistributedCacheShouldOverrideIt()
329329
}
330330

331331
[Fact]
332-
public void MockDistributedCacheShouldBeDifferentForEveryCallAsynchronously()
332+
public void MockDistributedCacheShouldBeSameForAsyncronousCallToTestProvider()
333333
{
334334
Task
335335
.Run(async () =>
@@ -354,36 +354,36 @@ public void MockDistributedCacheShouldBeDifferentForEveryCallAsynchronously()
354354
Task.Run(() =>
355355
{
356356
var distributedCache = TestServiceProvider.GetService<IDistributedCache>();
357-
distributedCache.Set("test", new byte[]{ 1 });
358-
firstValue = TestServiceProvider.GetService<IDistributedCache>().Get("test");
357+
distributedCache.Set("test1", new byte[]{ 1 });
358+
firstValue = TestServiceProvider.GetService<IDistributedCache>().Get("test1");
359359
TestHelper.ExecuteTestCleanup();
360360
}),
361361
Task.Run(() =>
362362
{
363363
var distributedCache = TestServiceProvider.GetService<IDistributedCache>();
364-
distributedCache.Set("test", new byte[]{ 2 });
365-
secondValue = TestServiceProvider.GetService<IDistributedCache>().Get("test");
364+
distributedCache.Set("test2", new byte[]{ 2 });
365+
secondValue = TestServiceProvider.GetService<IDistributedCache>().Get("test2");
366366
TestHelper.ExecuteTestCleanup();
367367
}),
368368
Task.Run(() =>
369369
{
370370
var distributedCache = TestServiceProvider.GetService<IDistributedCache>();
371-
distributedCache.Set("test", new byte[]{ 3 });
372-
thirdValue = TestServiceProvider.GetService<IDistributedCache>().Get("test");
371+
distributedCache.Set("test3", new byte[]{ 3 });
372+
thirdValue = TestServiceProvider.GetService<IDistributedCache>().Get("test3");
373373
TestHelper.ExecuteTestCleanup();
374374
}),
375375
Task.Run(() =>
376376
{
377377
var distributedCache = TestServiceProvider.GetService<IDistributedCache>();
378-
distributedCache.Set("test", new byte[]{ 4 });
379-
fourthValue = TestServiceProvider.GetService<IDistributedCache>().Get("test");
378+
distributedCache.Set("test4", new byte[]{ 4 });
379+
fourthValue = TestServiceProvider.GetService<IDistributedCache>().Get("test4");
380380
TestHelper.ExecuteTestCleanup();
381381
}),
382382
Task.Run(() =>
383383
{
384384
var distributedCache = TestServiceProvider.GetService<IDistributedCache>();
385-
distributedCache.Set("test", new byte[]{ 5 });
386-
fifthValue = TestServiceProvider.GetService<IDistributedCache>().Get("test");
385+
distributedCache.Set("test5", new byte[]{ 5 });
386+
fifthValue = TestServiceProvider.GetService<IDistributedCache>().Get("test5");
387387
TestHelper.ExecuteTestCleanup();
388388
})
389389
};

0 commit comments

Comments
 (0)