Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Description>Top 2000 Features package using the SQLite database</Description>
<Copyright>Copyright (c) Rick Neeft Development 2024</Copyright>
<PackageProjectUrl>https://github.com/Top2000app/data</PackageProjectUrl>
<Version>2.0.0</Version>
<Version>2.1.0</Version>
<Authors>Rick Neeft</Authors>
<Product>Top2000App</Product>
<PackageIcon>nugeticon.png</PackageIcon>
Expand All @@ -28,7 +28,7 @@

<ItemGroup>
<PackageReference Include="MediatR" Version="12.4.1" />
<PackageReference Include="RickNeeftDevelopment.Top2000App.Data" Version="2.0.0" />
<PackageReference Include="RickNeeftDevelopment.Top2000App.Data" Version="2.1.0" />
<PackageReference Include="RickNeeftDevelopment.Top2000App.Features" Version="1.1.0" />
</ItemGroup>

Expand Down
11 changes: 6 additions & 5 deletions tests/Top2000.Features.Specs/Bindings/Top2000DataSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,19 @@ public async Task WhenTheClientDatabaseIsCreatedAsync()
await update.RunAsync(assemblySource);
}

[Then(@"except for the last edition, the listing table contains 2000 tracks for each edition ranging from 1 to 2000")]
[Then(@"the listing table contains 2000 tracks for each edition ranging from 1 to 2000")]
public async Task ThenThePositionTableContainsTracksForEachEditionRangingFromTo()
{
var sql = App.GetService<SQLiteAsyncConnection>();
var lists = (await sql.Table<Listing>().ToListAsync())
.Where(x => x.Edition != 2023)
.GroupBy(x => x.Edition)
.OrderBy(x => x.Key)
.ToList();

var expected = Enumerable.Range(1, 2000);

for (var i = 0; i < lists.Count - 2; i++)
for (var i = 0; i < lists.Count -1 ; i++)
{
var yearPositions = lists[i].Select(x => x.Position).OrderBy(x => x);
yearPositions.Should().BeEquivalentTo(expected);
Expand Down Expand Up @@ -94,10 +95,10 @@ public async Task WhenTheLatestEditionIsQueried()
.Last();
}

[Then("the latest edition contains either {int} or {int} or {int} items")]
public void ThenTheLatestEditionContainsEitherOrOrItems(int p0, int p1, int p2)
[Then("the latest edition contains either {int} or {int} items")]
public void ThenTheLatestEditionContainsEitherOrOrItems(int p0, int p1)
{
latestEdition.Count().Should().BeOneOf(p0, p1, p2);
latestEdition.Count().Should().BeOneOf(p0, p1);
}

[Then(@"for each track in the listing table the PlayDateAndTime is the same to the previous track or has incremented by one hour")]
Expand Down
1 change: 1 addition & 0 deletions tests/Top2000.Features.Specs/Features/AllEditions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Then the UTC Statdate is as follow:
| 2020 | 2020-12-24T23:00:00 |
| 2021 | 2021-12-24T23:00:00 |
| 2022 | 2022-12-24T23:00:00 |
| 2024 | 2024-12-24T23:00:00 |

Scenario: The List of 2023 started earlier than usual because it was the 25 edition
Given All data scripts
Expand Down
11 changes: 7 additions & 4 deletions tests/Top2000.Features.Specs/Features/AllEditions.feature.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tests/Top2000.Features.Specs/Features/Top2000Data.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Background: Data for the Top2000 app is stored in SQL scripts inside the `Data.S

On the offcial Top2000 website (www.top2000.nl) people can choose their top tracks for the Top2000. After the voting week the first 10 tracks are published. A few days before the show starts the full list is published.

Scenario: All editions, except for the last, contains 2000 positions starting with 1 and ending with 2000
Scenario: All editions contains 2000 positions starting with 1 and ending with 2000
Given the client database is created
Then except for the last edition, the listing table contains 2000 tracks for each edition ranging from 1 to 2000
Then the listing table contains 2000 tracks for each edition ranging from 1 to 2000

Scenario: The last edition can either have 10 or 2000 tracks
Given the client database is created
When the latest edition is queried
Then the latest edition contains either 10 or 2000 or 2500 items
Then the latest edition contains either 10 or 2000 items

Scenario: The playtime of each track is either the same to the last track or increment by one hour
Given the client database is created
Expand Down
13 changes: 5 additions & 8 deletions tests/Top2000.Features.Specs/Features/Top2000Data.feature.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ Scenario: 'Since release' is the statistic that shows how many times the tracks
Given the client database is created
When the track information feature is executed for TrackId 3966
Then the title is "Hello" from 'Adele' which is recorded in the year 2015
And it could have been on the Top2000 for 9 times
And is it listed for 9 times
And it could have been on the Top2000 for 10 times
And is it listed for 10 times

Scenario: Record high shows the highest listing for the track
Given the client database is created
Expand All @@ -111,7 +111,7 @@ Scenario: Last postion shows the position of latest edition where the track was
Given the client database is created
When the track information feature is executed for TrackId 1496
Then the title is "Imagine" from 'John Lennon' which is recorded in the year 1971
And the Lastest position is number 33 in 2023
And the Lastest position is number 46 in 2024

Scenario: First position shows the position of the first edition where the track was listed
Given the client database is created
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion tests/Top2000.Features.Specs/Top2000.Features.Specs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
<PackageReference Include="Reqnroll.MsTest" Version="2.2.1" />
<PackageReference Include="RickNeeftDevelopment.Top2000App.Data" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading