From 3a3bc06ffc6eb932363e3076bff46d56b342365e Mon Sep 17 00:00:00 2001 From: Rick Neeft Date: Fri, 13 Dec 2024 20:29:43 +0100 Subject: [PATCH] 2024 updates --- .../Top2000.Features.SQLite.csproj | 4 ++-- .../Bindings/Top2000DataSteps.cs | 11 ++++++----- .../Features/AllEditions.feature | 1 + .../Features/AllEditions.feature.cs | 11 +++++++---- .../Features/Top2000Data.feature | 6 +++--- .../Features/Top2000Data.feature.cs | 13 +++++-------- .../Features/TrackInformation.feature | 6 +++--- .../Features/TrackInformation.feature.cs | 6 +++--- .../Top2000.Features.Specs.csproj | 1 - 9 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/SQLite/Top2000.Features.SQLite/Top2000.Features.SQLite.csproj b/src/SQLite/Top2000.Features.SQLite/Top2000.Features.SQLite.csproj index 7208ed1..de095db 100644 --- a/src/SQLite/Top2000.Features.SQLite/Top2000.Features.SQLite.csproj +++ b/src/SQLite/Top2000.Features.SQLite/Top2000.Features.SQLite.csproj @@ -11,7 +11,7 @@ Top 2000 Features package using the SQLite database Copyright (c) Rick Neeft Development 2024 https://github.com/Top2000app/data - 2.0.0 + 2.1.0 Rick Neeft Top2000App nugeticon.png @@ -28,7 +28,7 @@ - + diff --git a/tests/Top2000.Features.Specs/Bindings/Top2000DataSteps.cs b/tests/Top2000.Features.Specs/Bindings/Top2000DataSteps.cs index 7e3076f..8c3bbd7 100644 --- a/tests/Top2000.Features.Specs/Bindings/Top2000DataSteps.cs +++ b/tests/Top2000.Features.Specs/Bindings/Top2000DataSteps.cs @@ -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(); var lists = (await sql.Table().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); @@ -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")] diff --git a/tests/Top2000.Features.Specs/Features/AllEditions.feature b/tests/Top2000.Features.Specs/Features/AllEditions.feature index f017fee..ac5e86d 100644 --- a/tests/Top2000.Features.Specs/Features/AllEditions.feature +++ b/tests/Top2000.Features.Specs/Features/AllEditions.feature @@ -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 diff --git a/tests/Top2000.Features.Specs/Features/AllEditions.feature.cs b/tests/Top2000.Features.Specs/Features/AllEditions.feature.cs index a4762fa..b54e8da 100644 --- a/tests/Top2000.Features.Specs/Features/AllEditions.feature.cs +++ b/tests/Top2000.Features.Specs/Features/AllEditions.feature.cs @@ -419,6 +419,9 @@ public async System.Threading.Tasks.Task AsFrom2020TheTop2000StartsAtTheStartOfB table5.AddRow(new string[] { "2022", "2022-12-24T23:00:00"}); + table5.AddRow(new string[] { + "2024", + "2024-12-24T23:00:00"}); #line 65 await testRunner.ThenAsync("the UTC Statdate is as follow:", ((string)(null)), table5, "Then "); #line hidden @@ -434,7 +437,7 @@ public async System.Threading.Tasks.Task TheListOf2023StartedEarlierThanUsualBec string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("The List of 2023 started earlier than usual because it was the 25 edition", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 71 +#line 72 this.ScenarioInitialize(scenarioInfo); #line hidden if ((global::Reqnroll.TagHelper.ContainsIgnoreTag(scenarioInfo.CombinedTags) || global::Reqnroll.TagHelper.ContainsIgnoreTag(featureTags))) @@ -444,10 +447,10 @@ public async System.Threading.Tasks.Task TheListOf2023StartedEarlierThanUsualBec else { await this.ScenarioStartAsync(); -#line 72 +#line 73 await testRunner.GivenAsync("All data scripts", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden -#line 73 +#line 74 await testRunner.WhenAsync("the feature is executed", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden global::Reqnroll.Table table6 = new global::Reqnroll.Table(new string[] { @@ -456,7 +459,7 @@ public async System.Threading.Tasks.Task TheListOf2023StartedEarlierThanUsualBec table6.AddRow(new string[] { "2023", "2023-12-11T09:00:00"}); -#line 74 +#line 75 await testRunner.ThenAsync("the UTC Statdate is as follow:", ((string)(null)), table6, "Then "); #line hidden } diff --git a/tests/Top2000.Features.Specs/Features/Top2000Data.feature b/tests/Top2000.Features.Specs/Features/Top2000Data.feature index cb9a768..00e7f70 100644 --- a/tests/Top2000.Features.Specs/Features/Top2000Data.feature +++ b/tests/Top2000.Features.Specs/Features/Top2000Data.feature @@ -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 diff --git a/tests/Top2000.Features.Specs/Features/Top2000Data.feature.cs b/tests/Top2000.Features.Specs/Features/Top2000Data.feature.cs index 83b4623..457f9cd 100644 --- a/tests/Top2000.Features.Specs/Features/Top2000Data.feature.cs +++ b/tests/Top2000.Features.Specs/Features/Top2000Data.feature.cs @@ -101,15 +101,13 @@ public virtual async System.Threading.Tasks.Task FeatureBackgroundAsync() } [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute()] - [Microsoft.VisualStudio.TestTools.UnitTesting.DescriptionAttribute(("All editions, except for the last, contains 2000 positions starting with 1 and en" + - "ding with 2000"))] + [Microsoft.VisualStudio.TestTools.UnitTesting.DescriptionAttribute("All editions contains 2000 positions starting with 1 and ending with 2000")] [Microsoft.VisualStudio.TestTools.UnitTesting.TestPropertyAttribute("FeatureTitle", "Top2000Data")] - public async System.Threading.Tasks.Task AllEditionsExceptForTheLastContains2000PositionsStartingWith1AndEndingWith2000() + public async System.Threading.Tasks.Task AllEditionsContains2000PositionsStartingWith1AndEndingWith2000() { string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); - global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo(("All editions, except for the last, contains 2000 positions starting with 1 and en" + - "ding with 2000"), null, tagsOfScenario, argumentsOfScenario, featureTags); + global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("All editions contains 2000 positions starting with 1 and ending with 2000", null, tagsOfScenario, argumentsOfScenario, featureTags); #line 7 this.ScenarioInitialize(scenarioInfo); #line hidden @@ -127,8 +125,7 @@ public async System.Threading.Tasks.Task AllEditionsExceptForTheLastContains2000 await testRunner.GivenAsync("the client database is created", ((string)(null)), ((global::Reqnroll.Table)(null)), "Given "); #line hidden #line 9 -await testRunner.ThenAsync(("except for the last edition, the listing table contains 2000 tracks for each edit" + - "ion ranging from 1 to 2000"), ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); +await testRunner.ThenAsync("the listing table contains 2000 tracks for each edition ranging from 1 to 2000", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden } await this.ScenarioCleanupAsync(); @@ -162,7 +159,7 @@ public async System.Threading.Tasks.Task TheLastEditionCanEitherHave10Or2000Trac await testRunner.WhenAsync("the latest edition is queried", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden #line 14 -await testRunner.ThenAsync("the latest edition contains either 10 or 2000 or 2500 items", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); +await testRunner.ThenAsync("the latest edition contains either 10 or 2000 items", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden } await this.ScenarioCleanupAsync(); diff --git a/tests/Top2000.Features.Specs/Features/TrackInformation.feature b/tests/Top2000.Features.Specs/Features/TrackInformation.feature index f1729a0..a120e11 100644 --- a/tests/Top2000.Features.Specs/Features/TrackInformation.feature +++ b/tests/Top2000.Features.Specs/Features/TrackInformation.feature @@ -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 @@ -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 diff --git a/tests/Top2000.Features.Specs/Features/TrackInformation.feature.cs b/tests/Top2000.Features.Specs/Features/TrackInformation.feature.cs index 0bfa00c..b4ead5e 100644 --- a/tests/Top2000.Features.Specs/Features/TrackInformation.feature.cs +++ b/tests/Top2000.Features.Specs/Features/TrackInformation.feature.cs @@ -540,10 +540,10 @@ public async System.Threading.Tasks.Task SinceReleaseIsTheStatisticThatShowsHowM await testRunner.ThenAsync("the title is \"Hello\" from \'Adele\' which is recorded in the year 2015", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden #line 95 -await testRunner.AndAsync("it could have been on the Top2000 for 9 times", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); +await testRunner.AndAsync("it could have been on the Top2000 for 10 times", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden #line 96 -await testRunner.AndAsync("is it listed for 9 times", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); +await testRunner.AndAsync("is it listed for 10 times", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden } await this.ScenarioCleanupAsync(); @@ -654,7 +654,7 @@ public async System.Threading.Tasks.Task LastPostionShowsThePositionOfLatestEdit await testRunner.ThenAsync("the title is \"Imagine\" from \'John Lennon\' which is recorded in the year 1971", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden #line 114 -await testRunner.AndAsync("the Lastest position is number 33 in 2023", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); +await testRunner.AndAsync("the Lastest position is number 46 in 2024", ((string)(null)), ((global::Reqnroll.Table)(null)), "And "); #line hidden } await this.ScenarioCleanupAsync(); diff --git a/tests/Top2000.Features.Specs/Top2000.Features.Specs.csproj b/tests/Top2000.Features.Specs/Top2000.Features.Specs.csproj index 20dd02e..f750d9f 100644 --- a/tests/Top2000.Features.Specs/Top2000.Features.Specs.csproj +++ b/tests/Top2000.Features.Specs/Top2000.Features.Specs.csproj @@ -29,7 +29,6 @@ -