File tree Expand file tree Collapse file tree 3 files changed +39
-4
lines changed
BitFaster.Caching.UnitTests Expand file tree Collapse file tree 3 files changed +39
-4
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,12 @@ public MpmcBoundedBufferSoakTests(ITestOutputHelper testOutputHelper)
2121 this . testOutputHelper = testOutputHelper ;
2222 }
2323
24- [ Fact ]
25- public async Task WhenAddIsContendedBufferCanBeFilled ( )
24+ [ Theory ]
25+ [ Repeat ( 3 ) ]
26+ public async Task WhenAddIsContendedBufferCanBeFilled ( int iteration )
2627 {
28+ this . testOutputHelper . WriteLine ( $ "Iteration { iteration } ") ;
29+
2730 await Threaded . Run ( 4 , ( ) =>
2831 {
2932 while ( buffer . TryAdd ( "hello" ) != BufferStatus . Full )
Original file line number Diff line number Diff line change @@ -21,9 +21,12 @@ public MpscBoundedBufferSoakTests(ITestOutputHelper testOutputHelper)
2121 this . testOutputHelper = testOutputHelper ;
2222 }
2323
24- [ Fact ]
25- public async Task WhenAddIsContendedBufferCanBeFilled ( )
24+ [ Theory ]
25+ [ Repeat ( 3 ) ]
26+ public async Task WhenAddIsContendedBufferCanBeFilled ( int iteration )
2627 {
28+ this . testOutputHelper . WriteLine ( $ "Iteration { iteration } ") ;
29+
2730 await Threaded . Run ( 4 , ( ) =>
2831 {
2932 while ( buffer . TryAdd ( "hello" ) != BufferStatus . Full )
Original file line number Diff line number Diff line change 1+ using System . Linq ;
2+
3+ namespace BitFaster . Caching . UnitTests
4+ {
5+ public sealed class RepeatAttribute : Xunit . Sdk . DataAttribute
6+ {
7+ private readonly int count ;
8+
9+ public RepeatAttribute ( int count )
10+ {
11+ if ( count < 1 )
12+ {
13+ throw new System . ArgumentOutOfRangeException (
14+ paramName : nameof ( count ) ,
15+ message : "Repeat count must be greater than 0."
16+ ) ;
17+ }
18+ this . count = count ;
19+ }
20+
21+ public override System . Collections . Generic . IEnumerable < object [ ] > GetData ( System . Reflection . MethodInfo testMethod )
22+ {
23+ foreach ( var iterationNumber in Enumerable . Range ( start : 1 , count : this . count ) )
24+ {
25+ yield return new object [ ] { iterationNumber } ;
26+ }
27+ }
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments