2020-02-23 11:57:25 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
|
using Steamworks.Data;
|
|
|
|
|
|
|
|
|
|
namespace Steamworks
|
|
|
|
|
{
|
|
|
|
|
[TestClass]
|
|
|
|
|
[DeploymentItem( "steam_api64.dll" )]
|
|
|
|
|
[DeploymentItem( "steam_api.dll" )]
|
|
|
|
|
public class GameServerStatsTest
|
|
|
|
|
{
|
|
|
|
|
static SteamId Garry = 76561197960279927;
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public async Task GetAchievement()
|
|
|
|
|
{
|
2020-02-24 16:28:27 +03:00
|
|
|
|
var result = await SteamServerStats.RequestUserStatsAsync( Garry );
|
2020-02-23 11:57:25 +03:00
|
|
|
|
Assert.AreEqual( result, Result.OK );
|
|
|
|
|
|
|
|
|
|
var value = SteamServerStats.GetAchievement( Garry, "COLLECT_100_WOOD" );
|
|
|
|
|
Assert.IsTrue( value );
|
|
|
|
|
|
|
|
|
|
value = SteamServerStats.GetAchievement( Garry, "ACHIVEMENT_THAT_DOESNT_EXIST" );
|
|
|
|
|
Assert.IsFalse( value );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|