Facepunch.Steamworks/Facepunch.Steamworks.Test/UgcTest.cs

42 lines
1.2 KiB
C#
Raw Permalink Normal View History

2019-04-26 18:42:46 +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" )]
2020-02-22 23:29:37 +03:00
[DeploymentItem( "steam_api.dll" )]
public class UgcTest
2019-04-26 18:42:46 +03:00
{
[TestMethod]
2019-05-14 12:23:21 +03:00
public void Download()
2019-04-26 18:42:46 +03:00
{
SteamUGC.Download( 1717844711 );
}
[TestMethod]
public async Task GetInformation()
{
2019-05-07 18:28:35 +03:00
var itemInfo = await Ugc.Item.GetAsync( 1720164672 );
2019-04-26 18:42:46 +03:00
Assert.IsTrue( itemInfo.HasValue );
Console.WriteLine( $"Title: {itemInfo?.Title}" );
Console.WriteLine( $"IsInstalled: {itemInfo?.IsInstalled}" );
Console.WriteLine( $"IsDownloading: {itemInfo?.IsDownloading}" );
Console.WriteLine( $"IsDownloadPending: {itemInfo?.IsDownloadPending}" );
Console.WriteLine( $"IsSubscribed: {itemInfo?.IsSubscribed}" );
Console.WriteLine( $"NeedsUpdate: {itemInfo?.NeedsUpdate}" );
Console.WriteLine( $"Description: {itemInfo?.Description}" );
2019-05-10 12:43:03 +03:00
Console.WriteLine( $"Owner: {itemInfo?.Owner}" );
Console.WriteLine( $"Score: {itemInfo?.Score}" );
Console.WriteLine( $"PreviewImageUrl: {itemInfo?.PreviewImageUrl}" );
2019-04-26 18:42:46 +03:00
}
}
}