mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-25 06:05:46 +03:00
RequireAllTags test
This commit is contained in:
parent
dfbbaaae47
commit
e668b7ff04
@ -95,6 +95,44 @@ public void QueryTagRequire()
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void QueryTagRequireMultiple()
|
||||
{
|
||||
using ( var client = new Facepunch.Steamworks.Client( 252490 ) )
|
||||
{
|
||||
Assert.IsTrue( client.IsValid );
|
||||
|
||||
using ( var Query = client.Workshop.CreateQuery() )
|
||||
{
|
||||
Query.RequireTags.Add( "LongTShirt Skin" );
|
||||
Query.RequireTags.Add( "version2" );
|
||||
Query.RequireAllTags = true;
|
||||
Query.Run();
|
||||
|
||||
Query.Block();
|
||||
|
||||
Assert.IsFalse( Query.IsRunning );
|
||||
Assert.IsTrue( Query.TotalResults > 0 );
|
||||
Assert.IsTrue( Query.Items.Length > 0 );
|
||||
|
||||
Console.WriteLine( "Query.TotalResults: {0}", Query.TotalResults );
|
||||
Console.WriteLine( "Query.Items.Length: {0}", Query.Items.Length );
|
||||
|
||||
Assert.IsTrue( Query.TotalResults > 0 );
|
||||
Assert.IsTrue( Query.Items.Length > 0 );
|
||||
|
||||
foreach ( var item in Query.Items )
|
||||
{
|
||||
Console.WriteLine( "{0}", item.Title );
|
||||
Console.WriteLine( "\t{0}", string.Join( ";", item.Tags ) );
|
||||
|
||||
Assert.IsTrue( item.Tags.Contains( "LongTShirt Skin" ) );
|
||||
Assert.IsTrue( item.Tags.Contains( "version2" ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void QueryTagExclude()
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ public unsafe void Run()
|
||||
workshop.ugc.AddRequiredTag( Handle, tag );
|
||||
|
||||
if ( RequireTags.Count > 0 )
|
||||
workshop.ugc.SetMatchAnyTag( Handle, RequireAllTags );
|
||||
workshop.ugc.SetMatchAnyTag( Handle, !RequireAllTags );
|
||||
|
||||
foreach ( var tag in ExcludeTags )
|
||||
workshop.ugc.AddExcludedTag( Handle, tag );
|
||||
|
Loading…
Reference in New Issue
Block a user