74 lines
1.5 KiB
C#
Raw Normal View History

2017-03-13 20:05:32 +00:00
using System;
2019-04-12 21:30:13 +01:00
using System.Linq;
2017-03-13 20:05:32 +00:00
using System.Text;
using System.Threading;
2019-04-12 22:53:46 +01:00
using System.Threading.Tasks;
2017-03-13 20:05:32 +00:00
using Microsoft.VisualStudio.TestTools.UnitTesting;
2019-04-12 21:30:13 +01:00
namespace Steamworks
2017-03-13 20:05:32 +00:00
{
[TestClass]
[DeploymentItem( "steam_api64.dll" )]
2019-04-12 21:30:13 +01:00
public class AppTest
2017-03-13 20:05:32 +00:00
{
2019-04-12 21:30:13 +01:00
[AssemblyInitialize]
public static void AssemblyInit( TestContext context )
{
Steamworks.Steam.Init( 4000 );
}
[TestMethod]
public void GameLangauge()
2017-03-13 20:05:32 +00:00
{
2019-04-12 21:30:13 +01:00
var gl = Apps.GameLanguage;
Assert.IsNotNull( gl );
Assert.IsTrue( gl.Length > 3 );
2017-03-13 20:05:32 +00:00
2019-04-12 21:30:13 +01:00
Console.WriteLine( $"{gl}" );
}
2017-03-13 20:05:32 +00:00
2019-04-12 21:47:02 +01: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 21:30:13 +01:00
[TestMethod]
public void InstalledDepots()
{
var depots = Apps.InstalledDepots( 4000 ).ToArray();
2017-03-13 20:05:32 +00:00
2019-04-12 21:30:13 +01:00
Assert.IsNotNull( depots );
Assert.IsTrue( depots.Length > 0 );
2017-03-13 20:05:32 +00:00
2019-04-12 21:30:13 +01:00
foreach ( var depot in depots )
{
Console.WriteLine( $"{depot.Value}" );
}
}
2019-04-12 22:53:46 +01:00
[TestMethod]
public async Task GetFileDetails()
{
var fileinfo = await Apps.GetFileDetails( "hl2.exe" );
2019-04-13 18:47:36 +01:00
Console.WriteLine( $"fileinfo.SizeInBytes: {fileinfo.SizeInBytes}" );
2019-04-12 22:53:46 +01:00
}
2019-04-12 21:30:13 +01:00
}
2017-03-13 20:05:32 +00:00
}