diff --git a/Facepunch.Steamworks.Test/Client/App.cs b/Facepunch.Steamworks.Test/Client/App.cs new file mode 100644 index 0000000..984e2fb --- /dev/null +++ b/Facepunch.Steamworks.Test/Client/App.cs @@ -0,0 +1,56 @@ +using System; +using System.Text; +using System.Threading; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Facepunch.Steamworks.Test +{ + [TestClass] + [DeploymentItem( "steam_api.dll" )] + [DeploymentItem( "steam_api64.dll" )] + [DeploymentItem( "steam_appid.txt" )] + public class App + { + [TestMethod] + public void IsSubscribed() + { + using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) + { + Console.WriteLine("This test assumes you own Garry's Mod and not Charles III of Spain and the antiquity"); + + Assert.IsTrue( client.App.IsSubscribed( 4000 ) ); + Assert.IsFalse( client.App.IsSubscribed( 590440 )); + } + } + + [TestMethod] + public void IsInstalled() + { + using (var client = new Facepunch.Steamworks.Client(252490)) + { + Console.WriteLine("This test assumes you have Garry's Mod installed but not Charles III of Spain and the antiquity"); + + Assert.IsTrue(client.App.IsInstalled(4000)); + Assert.IsFalse(client.App.IsInstalled(590440)); + } + } + + [TestMethod] + public void PurchaseTime() + { + using (var client = new Facepunch.Steamworks.Client(252490)) + { + Console.WriteLine("This test assumes you own Garry's Mod but not Charles III of Spain and the antiquity"); + + var gmodBuyTime = client.App.PurchaseTime( 4000 ); + Assert.AreNotEqual( gmodBuyTime, DateTime.MinValue ); + + Console.WriteLine($"You bought Garry's Mod {gmodBuyTime}"); + + var otherBuyTime = client.App.PurchaseTime(590440); + Assert.AreEqual(otherBuyTime, DateTime.MinValue); + } + } + + } +} diff --git a/Facepunch.Steamworks.Test/Facepunch.Steamworks.Test.csproj b/Facepunch.Steamworks.Test/Facepunch.Steamworks.Test.csproj index 4eeecf3..8611793 100644 --- a/Facepunch.Steamworks.Test/Facepunch.Steamworks.Test.csproj +++ b/Facepunch.Steamworks.Test/Facepunch.Steamworks.Test.csproj @@ -94,6 +94,7 @@ +