33using System . Collections . Generic ;
44using System . Linq ;
55using System . Threading . Tasks ;
6- using FluentAssertions ;
6+ using AwesomeAssertions ;
77using Microsoft . VisualStudio . TestTools . UnitTesting ;
88
99namespace MemoryCacheNetCore . Tests
@@ -16,7 +16,7 @@ public class InMemoryCacheTests
1616 private const int MoreThanCacheDurationInSeconds = 3 ;
1717 private static readonly Random Random = new ( Guid . NewGuid ( ) . GetHashCode ( ) ) ;
1818
19- [ TestMethod , Timeout ( Timeout ) ]
19+ [ TestMethod , Timeout ( Timeout , CooperativeCancellation = true ) ]
2020 public async Task Get_Old_Value_When_Delay_Is_Not_Expired ( )
2121 {
2222 var cache = new InMemoryCache ( CacheDurationInSeconds ) ;
@@ -40,7 +40,7 @@ public async Task Get_Old_Value_When_Delay_Is_Not_Expired()
4040 yy . Should ( ) . Be ( 10 ) ;
4141 }
4242
43- [ TestMethod , Timeout ( Timeout ) ]
43+ [ TestMethod , Timeout ( Timeout , CooperativeCancellation = true ) ]
4444 public async Task Get_New_Value_When_Delay_Is_Expired ( )
4545 {
4646 var cache = new InMemoryCache ( CacheDurationInSeconds ) ;
@@ -66,7 +66,7 @@ public async Task Get_New_Value_When_Delay_Is_Expired()
6666 yy . Should ( ) . Be ( 20 ) ;
6767 }
6868
69- [ TestMethod , Timeout ( Timeout ) ]
69+ [ TestMethod , Timeout ( Timeout , CooperativeCancellation = true ) ]
7070 public async Task Get_New_Value_When_Delay_Is_Not_Expired_And_Cache_Was_Flushed ( )
7171 {
7272 var cache = new InMemoryCache ( CacheDurationInSeconds ) ;
@@ -92,7 +92,7 @@ public async Task Get_New_Value_When_Delay_Is_Not_Expired_And_Cache_Was_Flushed(
9292 yy . Should ( ) . Be ( 20 ) ;
9393 }
9494
95- [ TestMethod , Timeout ( Timeout ) ]
95+ [ TestMethod , Timeout ( Timeout , CooperativeCancellation = true ) ]
9696 public async Task Should_Not_Throw_Exception_When_Cache_Is_Flushed_While_Is_Used_V1 ( )
9797 {
9898 try
@@ -105,7 +105,7 @@ public async Task Should_Not_Throw_Exception_When_Cache_Is_Flushed_While_Is_Used
105105 }
106106 }
107107
108- [ TestMethod , Timeout ( Timeout ) ]
108+ [ TestMethod , Timeout ( Timeout , CooperativeCancellation = true ) ]
109109 public async Task Should_Not_Throw_Exception_When_Cache_Is_Flushed_While_Is_Used_V2 ( )
110110 {
111111 var cache = new InMemoryCache ( CacheDurationInSeconds ) ;
@@ -144,7 +144,7 @@ await Task.Run(async () =>
144144 cache . Size . Should ( ) . BeGreaterThan ( 0 ) ;
145145 }
146146
147- [ TestMethod , Timeout ( Timeout ) ]
147+ [ TestMethod , Timeout ( Timeout , CooperativeCancellation = true ) ]
148148 public async Task Should_Not_Throw_Exception_When_Cache_Is_Flushed_While_Is_Used_V3 ( )
149149 {
150150 var cache = new InMemoryCache ( CacheDurationInSeconds ) ;
0 commit comments