2019-04-14 23:32:48 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
|
|
|
|
|
|
namespace Steamworks
|
|
|
|
|
{
|
|
|
|
|
[TestClass]
|
|
|
|
|
[DeploymentItem( "steam_api64.dll" )]
|
2020-02-19 15:29:07 +03:00
|
|
|
|
[DeploymentItem( "steam_api.dll" )]
|
|
|
|
|
public class UtilsTest
|
2019-04-14 23:32:48 +03:00
|
|
|
|
{
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void SecondsSinceAppActive()
|
|
|
|
|
{
|
2019-04-16 16:21:48 +03:00
|
|
|
|
var time = SteamUtils.SecondsSinceAppActive;
|
2019-04-14 23:32:48 +03:00
|
|
|
|
Console.WriteLine( $"{time}" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void SecondsSinceComputerActive()
|
|
|
|
|
{
|
2019-04-16 16:21:48 +03:00
|
|
|
|
var time = SteamUtils.SecondsSinceComputerActive;
|
2019-04-14 23:32:48 +03:00
|
|
|
|
Console.WriteLine( $"{time}" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void ConnectedUniverse()
|
|
|
|
|
{
|
2019-04-16 16:21:48 +03:00
|
|
|
|
var u = SteamUtils.ConnectedUniverse;
|
2019-04-14 23:32:48 +03:00
|
|
|
|
Console.WriteLine( $"{u}" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void SteamServerTime()
|
|
|
|
|
{
|
2019-04-16 16:21:48 +03:00
|
|
|
|
var time = SteamUtils.SteamServerTime;
|
2019-04-14 23:32:48 +03:00
|
|
|
|
Console.WriteLine( $"{time}" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void IpCountry()
|
|
|
|
|
{
|
2019-04-16 16:21:48 +03:00
|
|
|
|
var cnt = SteamUtils.IpCountry;
|
2019-04-14 23:32:48 +03:00
|
|
|
|
Console.WriteLine( $"{cnt}" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void UsingBatteryPower()
|
|
|
|
|
{
|
2019-04-16 16:21:48 +03:00
|
|
|
|
var cnt = SteamUtils.UsingBatteryPower;
|
2019-04-14 23:32:48 +03:00
|
|
|
|
Console.WriteLine( $"{cnt}" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void CurrentBatteryPower()
|
|
|
|
|
{
|
2019-04-16 16:21:48 +03:00
|
|
|
|
var cnt = SteamUtils.CurrentBatteryPower;
|
2019-04-14 23:32:48 +03:00
|
|
|
|
Console.WriteLine( $"{cnt}" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void AppId()
|
|
|
|
|
{
|
2019-04-17 18:41:06 +03:00
|
|
|
|
var cnt = SteamClient.AppId;
|
2019-04-14 23:32:48 +03:00
|
|
|
|
|
|
|
|
|
Assert.IsTrue( cnt.Value > 0 );
|
|
|
|
|
|
|
|
|
|
Console.WriteLine( $"{cnt.Value}" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void IsOverlayEnabled()
|
|
|
|
|
{
|
2019-04-16 16:21:48 +03:00
|
|
|
|
var cnt = SteamUtils.IsOverlayEnabled;
|
2019-04-14 23:32:48 +03:00
|
|
|
|
Console.WriteLine( $"{cnt}" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public async Task CheckFileSignature()
|
|
|
|
|
{
|
2019-04-30 16:27:54 +03:00
|
|
|
|
var sig = await SteamUtils.CheckFileSignatureAsync( "hl2.exe" );
|
2019-04-14 23:32:48 +03:00
|
|
|
|
Console.WriteLine( $"{sig}" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void SteamUILanguage()
|
|
|
|
|
{
|
2019-04-16 16:21:48 +03:00
|
|
|
|
var cnt = SteamUtils.SteamUILanguage;
|
2019-04-14 23:32:48 +03:00
|
|
|
|
Console.WriteLine( $"{cnt}" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void IsSteamRunningInVR()
|
|
|
|
|
{
|
2019-04-16 16:21:48 +03:00
|
|
|
|
var cnt = SteamUtils.IsSteamRunningInVR;
|
2019-04-14 23:32:48 +03:00
|
|
|
|
Console.WriteLine( $"{cnt}" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void IsSteamInBigPictureMode()
|
|
|
|
|
{
|
2019-04-16 16:21:48 +03:00
|
|
|
|
var cnt = SteamUtils.IsSteamInBigPictureMode;
|
2019-04-14 23:32:48 +03:00
|
|
|
|
Console.WriteLine( $"{cnt}" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void VrHeadsetStreaming()
|
|
|
|
|
{
|
2019-04-16 16:21:48 +03:00
|
|
|
|
var cnt = SteamUtils.VrHeadsetStreaming;
|
2019-04-14 23:32:48 +03:00
|
|
|
|
Console.WriteLine( $"{cnt}" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|