Stats fixes

This commit is contained in:
Garry Newman 2019-04-27 16:12:16 +01:00
parent 194ca8d8b3
commit 5a25d750f2

View File

@ -162,32 +162,30 @@ namespace Steamworks
[TestMethod] [TestMethod]
public void GetStatInt() public void GetStatInt()
{ {
var startups = new Stat( "GMA_X_STARTUPS_STAT" ); var deaths = new Stat( "deaths" );
Console.WriteLine( $"{startups.Name} {startups.GetInt()} times" ); Console.WriteLine( $"{deaths.Name} {deaths.GetInt()} times" );
Console.WriteLine( $"{startups.Name} {startups.GetFloat()} times" ); Console.WriteLine( $"{deaths.Name} {deaths.GetFloat()} times" );
Assert.AreNotEqual( 0, startups.GetInt() ); Assert.AreNotEqual( 0, deaths.GetInt() );
} }
[TestMethod] [TestMethod]
public async Task GetStatGlobalInt() public async Task GetStatGlobalInt()
{ {
var startups = new Stat( "GMA_X_STARTUPS_STAT" ); var deaths = new Stat( "deaths" );
await startups.GetGlobalIntDays( 5 ); await deaths.GetGlobalIntDays( 5 );
await Task.Delay( 3000 ); var totalStartups = deaths.GetGlobalInt();
var totalStartups = startups.GetGlobalInt();
Assert.AreNotEqual( 0, totalStartups ); Assert.AreNotEqual( 0, totalStartups );
Console.WriteLine( $"Garry's Mod has been started {totalStartups} times" ); Console.WriteLine( $"Rust has had {totalStartups} deaths" );
} }
[TestMethod] [TestMethod]
public async Task GetStatGlobalHistoryInt() public async Task GetStatGlobalHistoryInt()
{ {
var startups = new Stat( "GMA_X_STARTUPS_STAT" ); var deaths = new Stat( "deaths" );
var history = await startups.GetGlobalIntDays( 60 ); var history = await deaths.GetGlobalIntDays( 10 );
Assert.AreNotEqual( 0, history.Length ); Assert.AreNotEqual( 0, history.Length );
for ( int i=0; i< history.Length; i++ ) for ( int i=0; i< history.Length; i++ )