Facepunch.Steamworks/Facepunch.Steamworks.Test/Client/AppTest.cs

90 lines
1.8 KiB
C#
Raw Normal View History

2017-03-13 23:05:32 +03:00
using System;
2019-04-12 23:30:13 +03:00
using System.Linq;
2017-03-13 23:05:32 +03:00
using System.Text;
using System.Threading;
2019-04-13 00:53:46 +03:00
using System.Threading.Tasks;
2017-03-13 23:05:32 +03:00
using Microsoft.VisualStudio.TestTools.UnitTesting;
2019-04-12 23:30:13 +03:00
namespace Steamworks
2017-03-13 23:05:32 +03:00
{
[TestClass]
[DeploymentItem( "steam_api64.dll" )]
2019-04-12 23:30:13 +03:00
public class AppTest
2017-03-13 23:05:32 +03:00
{
2019-04-12 23:30:13 +03:00
[AssemblyInitialize]
public static void AssemblyInit( TestContext context )
{
Steamworks.Steam.Init( 4000 );
}
2019-04-14 00:02:52 +03:00
static void OnNewUrlLaunchParameters()
{
// Wow!
}
2019-04-12 23:30:13 +03:00
[TestMethod]
public void GameLangauge()
2017-03-13 23:05:32 +03:00
{
2019-04-12 23:30:13 +03:00
var gl = Apps.GameLanguage;
Assert.IsNotNull( gl );
Assert.IsTrue( gl.Length > 3 );
2017-03-13 23:05:32 +03:00
2019-04-12 23:30:13 +03:00
Console.WriteLine( $"{gl}" );
}
2017-03-13 23:05:32 +03:00
2019-04-12 23:47:02 +03:00
[TestMethod]
public void AppInstallDir()
{
var str = Apps.AppInstallDir( 4000 );
Assert.IsNotNull( str );
Assert.IsTrue( str.Length > 3 );
Console.WriteLine( $"{str}" );
}
[TestMethod]
public void AppOwner()
{
var steamid = Apps.AppOwner;
Assert.IsTrue( steamid.Value > 70561197960279927 );
Assert.IsTrue( steamid.Value < 80561197960279927 );
Console.WriteLine( $"{steamid.Value}" );
}
2019-04-12 23:30:13 +03:00
[TestMethod]
public void InstalledDepots()
{
var depots = Apps.InstalledDepots( 4000 ).ToArray();
2017-03-13 23:05:32 +03:00
2019-04-12 23:30:13 +03:00
Assert.IsNotNull( depots );
Assert.IsTrue( depots.Length > 0 );
2017-03-13 23:05:32 +03:00
2019-04-12 23:30:13 +03:00
foreach ( var depot in depots )
{
Console.WriteLine( $"{depot.Value}" );
}
}
2019-04-13 00:53:46 +03:00
[TestMethod]
public async Task GetFileDetails()
{
2019-04-15 13:06:32 +03:00
var fileinfo = await Apps.GetFileDetailsAsync( "hl2.exe" );
2019-04-13 20:47:36 +03:00
2019-04-13 23:20:25 +03:00
Console.WriteLine( $"fileinfo.Found: {fileinfo.Found}" );
2019-04-13 20:47:36 +03:00
Console.WriteLine( $"fileinfo.SizeInBytes: {fileinfo.SizeInBytes}" );
2019-04-13 23:20:25 +03:00
Console.WriteLine( $"fileinfo.Sha1: {fileinfo.Sha1}" );
Console.WriteLine( $"fileinfo.Flags: {fileinfo.Flags}" );
2019-04-13 00:53:46 +03:00
}
2019-04-13 23:26:10 +03:00
[TestMethod]
2019-04-15 13:06:32 +03:00
public void CommandLine()
2019-04-13 23:26:10 +03:00
{
var cl = Apps.CommandLine;
Console.WriteLine( $"CommandLine: {cl}" );
}
2019-04-12 23:30:13 +03:00
}
2017-03-13 23:05:32 +03:00
}