Chnaged RequestEncryptedAppTicketAsync tests to keep in mind that it can only be called once every 60 seconds

This commit is contained in:
Garry Newman 2020-02-25 13:29:15 +00:00
parent 59eabc1302
commit 998c18764a

View File

@ -136,19 +136,43 @@ public void IsPhoneRequiringVerification()
[TestMethod]
public async Task RequestEncryptedAppTicketAsyncWithData()
{
var data = await SteamUser.RequestEncryptedAppTicketAsync( new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 } );
Assert.IsNotNull( data );
for ( int i=0; i<10; i++ )
{
var data = await SteamUser.RequestEncryptedAppTicketAsync( new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 } );
Console.WriteLine( $"data: {string.Join( "", data.Select( x => x.ToString( "x" ) ))}" );
if ( data == null )
{
Console.WriteLine( $"Attempt {i}: Returned null.. waiting 1 seconds" );
await Task.Delay( 10000 );
continue;
}
Console.WriteLine( $"data: {string.Join( "", data.Select( x => x.ToString( "x" ) ) )}" );
return;
}
Assert.Fail();
}
[TestMethod]
public async Task RequestEncryptedAppTicketAsync()
{
var data = await SteamUser.RequestEncryptedAppTicketAsync();
Assert.IsNotNull( data );
for ( int i = 0; i < 6; i++ )
{
var data = await SteamUser.RequestEncryptedAppTicketAsync();
Console.WriteLine( $"data: {string.Join( "", data.Select( x => x.ToString( "x" ) ) )}" );
if ( data == null )
{
Console.WriteLine( $"Attempt {i}: Returned null.. waiting 1 seconds" );
await Task.Delay( 10000 );
continue;
}
Console.WriteLine( $"data: {string.Join( "", data.Select( x => x.ToString( "x" ) ) )}" );
return;
}
Assert.Fail();
}
}