-
Notifications
You must be signed in to change notification settings - Fork 0
/
UgcTests.cs
executable file
·74 lines (64 loc) · 2.29 KB
/
UgcTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright (c) 2022 AccelByte Inc. All Rights Reserved.
// This is licensed software from AccelByte Inc, for limitations
// and restrictions contact your company contract manager.
using System;
using System.Collections.Generic;
using NUnit.Framework;
using AccelByte.Sdk.Core;
using AccelByte.Sdk.Api;
using AccelByte.Sdk.Api.Ugc.Model;
namespace AccelByte.Sdk.Tests.Services
{
[TestFixture(Category = "FluentIntegration")]
[Explicit]
public class UgcTests : BaseServiceTests
{
public UgcTests() : base(true) { }
[Test]
public void UGCServiceTests()
{
Assert.IsNotNull(_Sdk);
if (_Sdk == null)
return;
string tag_name = "csharp_server_sdk_test";
string tag_name_u = "csharp_server_sdk_test_update";
string tag_id = String.Empty;
#region Create a tag
ModelsCreateTagRequest createTag = new ModelsCreateTagRequest()
{
Tag = tag_name
};
ModelsCreateTagResponse? cTag = _Sdk.Ugc.AdminTag.AdminCreateTagOp
.Execute(createTag, _Sdk.Namespace);
#endregion
Assert.IsNotNull(cTag);
if (cTag != null)
{
Assert.AreEqual(tag_name, cTag.Tag);
tag_id = cTag.Id!;
}
#region Get tags
ModelsPaginatedGetTagResponse? gTag = _Sdk.Ugc.AdminTag.AdminGetTagOp
.SetOffset(0)
.SetLimit(10)
.Execute(_Sdk.Namespace);
#endregion
Assert.IsNotNull(gTag);
#region Update a tag
ModelsCreateTagRequest updateTag = new ModelsCreateTagRequest()
{
Tag = tag_name_u
};
ModelsCreateTagResponse? uTag = _Sdk.Ugc.AdminTag.AdminUpdateTagOp
.Execute(updateTag, _Sdk.Namespace, tag_id);
#endregion
Assert.IsNotNull(uTag);
if (uTag != null)
Assert.AreEqual(tag_name_u, uTag.Tag);
#region Delete a tag
_Sdk.Ugc.AdminTag.AdminDeleteTagOp
.Execute(_Sdk.Namespace, tag_id);
#endregion
}
}
}