-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements detected in first field test (#9)
- Loading branch information
1 parent
c4e1c54
commit 4365a6b
Showing
9 changed files
with
103 additions
and
36 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
45 changes: 45 additions & 0 deletions
45
LichessTournamentAggregator.Test/TournamentAggregatorTest.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,45 @@ | ||
using System.Linq; | ||
using Xunit; | ||
|
||
namespace LichessTournamentAggregator.Test | ||
{ | ||
public class TournamentAggregatorTest | ||
{ | ||
private readonly TournamentAggregator _aggregator; | ||
|
||
public TournamentAggregatorTest() | ||
{ | ||
_aggregator = new TournamentAggregator(); | ||
} | ||
|
||
[Fact] | ||
public void GetUrls() | ||
{ | ||
const string tournamentId = "1op8aqN0"; | ||
|
||
var validInputs = new[] | ||
{ | ||
$"https://lichess.org/tournament/{tournamentId}#", | ||
$"https://lichess.org/tournament/{tournamentId}/", | ||
$"https://lichess.org/tournament/{tournamentId}#/", | ||
$"https://lichess.org/tournament/{tournamentId}/#", | ||
$"lichess.org/tournament/{tournamentId}#", | ||
$"lichess.org/tournament/{tournamentId}/", | ||
$"lichess.org/tournament/{tournamentId}#/", | ||
$"lichess.org/tournament/{tournamentId}/#", | ||
tournamentId, | ||
$"{tournamentId} ", | ||
$"{tournamentId}#", | ||
$"{tournamentId}/", | ||
$"{tournamentId}#/", | ||
$"{tournamentId}/#" | ||
}; | ||
|
||
var results = _aggregator.GetUrls(validInputs).ToList(); | ||
|
||
Assert.Equal( | ||
$"https://lichess.org/api/tournament/{tournamentId}/results", | ||
results.ToHashSet().Single().OriginalString); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly: InternalsVisibleTo("LichessTournamentAggregator.Test")] |
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