File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
dotnet/Vaas/test/Vaas.Test Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1250,4 +1250,36 @@ await _vaas
12501250 . Should ( )
12511251 . ThrowAsync < OperationCanceledException > ( ) ;
12521252 }
1253+
1254+ [ Fact ]
1255+ public async Task ForFile_WithTimeout_ThrowsException ( )
1256+ {
1257+ var authenticator = new ClientCredentialsGrantAuthenticator (
1258+ AuthenticationEnvironment . ClientId ,
1259+ AuthenticationEnvironment . ClientSecret ,
1260+ AuthenticationEnvironment . TokenUrl
1261+ ) ;
1262+ var options = new VaasOptions
1263+ {
1264+ Timeout = 1 ,
1265+ UseCache = false ,
1266+ UseHashLookup = false ,
1267+ VaasUrl = new Uri ( "https://gateway.staging.vaas.gdatasecurity.de" ) ,
1268+ } ;
1269+ var vaas = new Vaas ( authenticator , options ) ;
1270+
1271+ try
1272+ {
1273+ var random100Mb = new byte [ 1000 * 1024 * 1024 ] ;
1274+ new Random ( ) . NextBytes ( random100Mb ) ;
1275+ await File . WriteAllBytesAsync ( "file.txt" , random100Mb ) ;
1276+ await vaas . Invoking ( async v => await v . ForFileAsync ( "file.txt" , CancellationToken . None ) )
1277+ . Should ( )
1278+ . ThrowAsync < TaskCanceledException > ( ) ;
1279+ }
1280+ finally
1281+ {
1282+ File . Delete ( "file.txt" ) ;
1283+ }
1284+ }
12531285}
You can’t perform that action at this time.
0 commit comments