File tree Expand file tree Collapse file tree
tests/SecureFolderFS.Tests/FileSystemTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using System ;
21using System . Text ;
3- using System . Threading ;
42using FluentAssertions ;
53using NUnit . Framework ;
64using OwlCore . Storage ;
@@ -40,7 +38,7 @@ public async Task Write_SmallStreamedFile_Then_WriteAgain_Ensure_CacheHit_NoThro
4038
4139 var cacheHits = 0 ;
4240 var cacheMisses = 0 ;
43- _storageRoot . Options . FileSystemStatistics . ChunkCache = new InlineProgress < CacheAccessType > ( x =>
41+ _storageRoot . Options . FileSystemStatistics . ChunkCache = new Progress < CacheAccessType > ( x =>
4442 {
4543 if ( x == CacheAccessType . CacheHit )
4644 Interlocked . Increment ( ref cacheHits ) ;
@@ -61,24 +59,12 @@ public async Task Write_SmallStreamedFile_Then_WriteAgain_Ensure_CacheHit_NoThro
6159 var buffer = new byte [ stream . Length ] ;
6260 var read = await stream . ReadAsync ( buffer ) ;
6361
64- Console . WriteLine ( $ "Cache Hits: { cacheHits } ") ;
65- Console . WriteLine ( $ "Cache Misses: { cacheMisses } ") ;
62+ Console . WriteLine ( $@ "Cache Hits: { cacheHits } ") ;
63+ Console . WriteLine ( $@ "Cache Misses: { cacheMisses } ") ;
6664
6765 read . Should ( ) . Be ( ( int ) stream . Length ) ;
6866 Encoding . UTF8 . GetString ( buffer ) . Should ( ) . BeEquivalentTo ( dataString + dataString ) ;
6967 cacheMisses . Should ( ) . Be ( 1 ) ;
7068 }
71-
72- private sealed class InlineProgress < T > : IProgress < T >
73- {
74- private readonly Action < T > _handler ;
75-
76- public InlineProgress ( Action < T > handler )
77- {
78- _handler = handler ?? throw new ArgumentNullException ( nameof ( handler ) ) ;
79- }
80-
81- public void Report ( T value ) => _handler ( value ) ;
82- }
8369 }
8470}
You can’t perform that action at this time.
0 commit comments