-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathUserUnit.cs
167 lines (149 loc) · 5.05 KB
/
UserUnit.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
using Fortnite.Core;
using Fortnite.Core.Interfaces;
using Fortnite.Localization;
using Fortnite.Model.Enums;
using Fortnite.Model.Responses.QueryProfile;
using Fortnite.Static;
using Fortnite.Static.Models.Combinations;
using fortniteLib.Responses.Pvp;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
namespace Fortnite.Tests
{
public class UserUnit : BaseUnit
{
[Fact]
[System.Obsolete]
public void User_UserIdByName()
{
var usr = Api.GetUserIdByName("Kesintisiz");
var prof = Api.GetPVEProfileById(usr.Value.id).Result;
Assert.True(1 >= 0);
}
[Fact]
public async void User_MythicSchematics()
{
var profile = await User_PVEQueryProfile();
var mythicSchematics = profile.Value.AmountOfMythicSchematics();
Assert.True(mythicSchematics >= 0);
}
[Fact]
public async void User_Alerts()
{
var profile = await User_PVEQueryProfile();
var resources = await profile.Value.GetAlerts();
Assert.True(resources.Values.Count > 0);
}
[Fact]
public async void User_Energy_Calculate()
{
do
{
var profile = await User_PVEQueryProfile();
IEnumerable<IGrouping<string, ISurvivorX>> survivorslots = await profile.Value.GetSurvivors();
var points = await survivorslots.CalcSurvivorFORTs();
int research = await profile.Value.CalcResearchFORTs();
var totalResources = points + research;
var energy = await SurvivorStaticData.CalcEnergyByFORT(totalResources);
Assert.True(energy >= 1);
}
while (true);
}
[Fact]
public async Task<KeyValuePair<string, IQueryProfile>> User_PVEQueryProfile()
{
var profile = await UserPVEQueryProfile("kesintisiz");
Assert.True(profile.Value != null);
return profile;
}
[Fact]
public async Task<KeyValuePair<string, BattleRoyaleStats>> User_PVPQueryProfile()
{
var profile = await UserPVPQueryProfile("kesintisiz");
Assert.True(profile.Value != null);
return profile;
}
[Fact]
public async void User_Resources()
{
var profile = await User_PVEQueryProfile();
var resources = await profile.Value.GetResources(GuildLanguage.EN.ToString());
Assert.True(resources != null);
}
[Fact]
public async Task<IEnumerable<IGrouping<string, ISurvivorX>>> User_Survivors()
{
var profile = await User_PVEQueryProfile();
var srvvr = await profile.Value.GetSurvivors();
Assert.True(srvvr != null);
return srvvr;
}
[Fact]
public void User_Schematics()
{
//to do
}
[Fact]
public async void User_Survivor_List()
{
var srvvr = await User_Survivors();
//to do
}
[Fact]
public async void User_SurvivorSquad_Requirements()
{
var svvrs = await User_Survivors();
var squads = await svvrs.GetSurvivorSquads();
}
[Fact]
public void User_Party()
{
//to do
}
[Fact]
public async void User_SurvivorSquad_Cobination()
{
var profile = await User_PVEQueryProfile();
var srvvr = profile.Value.GetSurvivorList().Select(f => new SurvivorCombination
{
Name = f.Value.templateId.GName().Result,
Type = f.Value.templateId.GType().Result,
SlotType = f.Value.attributes.squad_id,
Level = (byte)f.Value.attributes.level,
SlotId = (byte)f.Value.attributes.squad_slot_idx,
Tier = f.Value.templateId.GTier().Result,
Personality = f.Value.attributes.personality,
SetBonus = f.Value.attributes.set_bonus
}).ToList();
}
[Fact]
public void Local_TOP20()
{
try
{
var lst = Repo.StoredProcedure.SP_LocalTop20Async("465028350067605504");
}
catch (System.Exception e)
{
throw e;
}
Assert.True(true);
}
[Fact]
public async void User_Profile()
{
var profile = await User_PVPQueryProfile();
}
[Fact]
public async void User_Profile_PVP_STATS()
{
var profile = await User_PVPQueryProfile();
var sq = profile.Value.stats.BR_Placetop1(MatchType.squad, Platform.all, false);
var sl = profile.Value.stats.BR_Placetop1(MatchType.solo, Platform.all, false);
var d = profile.Value.stats.BR_Placetop1(MatchType.duo, Platform.all, false);
Assert.NotNull(profile.Value);
}
}
}