mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-21 10:27:18 +02:00
feat: graphql Client service tests
This commit is contained in:
1 parent
85ed224769
commit
63c49bc94d
2 files changed
+176
-2
No files matched your search
@@ -10,6 +10,18 @@ namespace WotBlitzStatisticsPro.Blazor.Services
|
||||
{
|
||||
public class GraphQlBackendMockService: IGraphQlBackendService
|
||||
{
|
||||
private readonly bool _needToWait;
|
||||
|
||||
public GraphQlBackendMockService()
|
||||
{
|
||||
_needToWait = true;
|
||||
}
|
||||
|
||||
public GraphQlBackendMockService(bool needToWait)
|
||||
{
|
||||
_needToWait = needToWait;
|
||||
}
|
||||
|
||||
public async Task<IReadOnlyList<IFindPlayers_Players>?> FindPlayers(string accountNick, RealmType realmType)
|
||||
{
|
||||
var result = new List<IFindPlayers_Players>();
|
||||
@@ -28,7 +40,10 @@ namespace WotBlitzStatisticsPro.Blazor.Services
|
||||
faker.Random.Number(30, 90)));
|
||||
}
|
||||
|
||||
await Task.Delay(1000);
|
||||
if (_needToWait)
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -51,7 +66,10 @@ namespace WotBlitzStatisticsPro.Blazor.Services
|
||||
}
|
||||
|
||||
|
||||
await Task.Delay(1000);
|
||||
if (_needToWait)
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user