-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite commands to use FafApiClient
- Loading branch information
Showing
10 changed files
with
111 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/Faforever.Qai.Core/Operations/Maps/ISearchMapOperation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
using System.Threading.Tasks; | ||
|
||
using Faforever.Qai.Core.Models; | ||
using Faforever.Qai.Core.Operations.FafApi; | ||
|
||
namespace Faforever.Qai.Core.Operations.Maps | ||
{ | ||
public interface ISearchMapOperation | ||
{ | ||
public Task<MapResult?> GetMapAsync(string map); | ||
public Task<MapResult?> GetMapAsync(int mapId); | ||
public Task<Map?> GetMapAsync(string map); | ||
public Task<Map?> GetMapAsync(int mapId); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
tests/Faforever.Qai.Core.Tests/Operations/FetchLadderPoolOperationTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Faforever.Qai.Core.Operations.Maps; | ||
using Faforever.Qai.Core.Operations.PatchNotes; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using NUnit.Framework; | ||
using System.Threading.Tasks; | ||
|
||
namespace Faforever.Qai.Core.Tests.Operations | ||
{ | ||
public class FetchLadderPoolOperationTest : OperationTestBase | ||
{ | ||
private IFetchLadderPoolOperation operation { get; set; } | ||
private IServiceScope scope { get; set; } | ||
|
||
[OneTimeSetUp] | ||
public void FetchReplaySetUp() | ||
{ | ||
scope = Services.CreateScope(); | ||
operation = scope.ServiceProvider.GetRequiredService<IFetchLadderPoolOperation>(); | ||
} | ||
|
||
[TestCase(TestName = "Fetch patch notes")] | ||
public async Task FetchPatchNotes() | ||
{ | ||
var res = await operation.FetchLadderPoolAsync(); | ||
|
||
Assert.NotNull(res); | ||
Assert.IsNotEmpty(res); | ||
} | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
tests/Faforever.Qai.Core.Tests/Operations/PlayerOperationTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
tests/Faforever.Qai.Core.Tests/Operations/SearchMapOperationTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Faforever.Qai.Core.Operations.Maps; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using NUnit.Framework; | ||
using System.Threading.Tasks; | ||
|
||
namespace Faforever.Qai.Core.Tests.Operations | ||
{ | ||
public class SearchMapOperationTest : OperationTestBase | ||
{ | ||
private ISearchMapOperation operation { get; set; } | ||
private IServiceScope scope { get; set; } | ||
|
||
[OneTimeSetUp] | ||
public void FetchReplaySetUp() | ||
{ | ||
scope = Services.CreateScope(); | ||
operation = scope.ServiceProvider.GetRequiredService<ISearchMapOperation>(); | ||
} | ||
|
||
[TestCase("DualGap_fix_adaptive", TestName = "Fetch map by name")] | ||
public async Task GetMapByName(string mapName) | ||
{ | ||
var res = await operation.GetMapAsync(mapName); | ||
|
||
Assert.NotNull(res); | ||
Assert.IsNotEmpty(res.DisplayName); | ||
} | ||
} | ||
} |