mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-26 06:35:49 +03:00
Added CreateChineseFile test
This commit is contained in:
parent
a0478a6040
commit
1d242fbc98
@ -33,6 +33,40 @@ public async Task CreateFile()
|
||||
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task CreateChineseFile()
|
||||
{
|
||||
string fileName = "这是我的项目";
|
||||
string description = "此项目由Facepunch Steamworks单元测试创建";
|
||||
|
||||
var result = await Ugc.Editor.NewCommunityFile
|
||||
.WithTitle( fileName )
|
||||
.WithDescription( description )
|
||||
.WithTag( "Arsehole" )
|
||||
.WithTag( "Spiteful" )
|
||||
.WithTag( "Fat-Head" )
|
||||
.SubmitAsync();
|
||||
|
||||
Console.WriteLine( $"Title: {fileName}" );
|
||||
Console.WriteLine( $"Description: {description}" );
|
||||
|
||||
Assert.IsTrue( result.Success );
|
||||
Assert.AreNotEqual( result.FileId.Value, 0 );
|
||||
|
||||
var file = await Steamworks.SteamUGC.QueryFileAsync( result.FileId );
|
||||
|
||||
Console.WriteLine( $"FileId: {result.FileId}" );
|
||||
Console.WriteLine( $"Title: {file.Value.Title}" );
|
||||
Console.WriteLine( $"Description: {file.Value.Description}" );
|
||||
|
||||
Assert.AreEqual( file.Value.Title, fileName );
|
||||
Assert.AreEqual( file.Value.Description, description );
|
||||
|
||||
var deleted = await SteamUGC.DeleteFileAsync( result.FileId );
|
||||
Assert.IsTrue( deleted );
|
||||
|
||||
}
|
||||
|
||||
class ProgressBar : IProgress<float>
|
||||
{
|
||||
float Value = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user