Skip to content

Commit 889e6ba

Browse files
authored
Merge pull request #8 from Top2000app/features/dotnet10
Features/dotnet10
2 parents e32cc16 + 6a5b7d7 commit 889e6ba

23 files changed

Lines changed: 892 additions & 638 deletions

.github/workflows/analyse.yml

Lines changed: 13 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,27 @@
1-
name: SonarCloud
1+
name: Analyse
22
on:
33
push:
4-
branches:
5-
- main
4+
branches: [ "main" ]
65
pull_request:
76
types: [opened, synchronize, reopened]
7+
88
jobs:
99
build:
10-
name: Build and analyze
11-
runs-on: windows-latest
10+
name: Build
11+
runs-on: ubuntu-latest
1212
steps:
13-
- name: Set up JDK 17
14-
uses: actions/setup-java@v3
15-
with:
16-
java-version: 17
17-
distribution: 'zulu' # Alternative distribution options are available.
18-
1913
- name: Setup .NET
2014
uses: actions/setup-dotnet@v4
2115
with:
22-
dotnet-version: 9.0.x
16+
dotnet-version: 10.0.x
2317

2418
- uses: actions/checkout@v3
25-
with:
26-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
27-
28-
- name: Cache SonarCloud packages
29-
uses: actions/cache@v3
30-
with:
31-
path: ~\sonar\cache
32-
key: ${{ runner.os }}-sonar
33-
restore-keys: ${{ runner.os }}-sonar
34-
35-
- name: Cache SonarCloud scanner
36-
id: cache-sonar-scanner
37-
uses: actions/cache@v3
38-
with:
39-
path: .\.sonar\scanner
40-
key: ${{ runner.os }}-sonar-scanner
41-
restore-keys: ${{ runner.os }}-sonar-scanner
42-
43-
- name: Install SonarCloud scanner
44-
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
45-
shell: powershell
46-
run: |
47-
New-Item -Path .\.sonar\scanner -ItemType Directory
48-
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
4919

50-
- name: Install dotnet coverage
51-
shell: powershell
52-
run: dotnet tool install dotnet-coverage --global
20+
- name: Restore dependencies
21+
run: dotnet restore
22+
23+
- name: Build
24+
run: dotnet build --no-restore
5325

54-
- name: Build and analyze
55-
env:
56-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
57-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
58-
shell: powershell
59-
run: |
60-
.\.sonar\scanner\dotnet-sonarscanner begin /k:"Top2000app_features" /o:"top2000app" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
61-
dotnet build
62-
dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml"
63-
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
26+
- name: Test
27+
run: dotnet test --no-build --verbosity normal

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup .NET
2222
uses: actions/setup-dotnet@v4
2323
with:
24-
dotnet-version: 9.0.x
24+
dotnet-version: 10.0.x
2525

2626
- name: Restore dependencies
2727
run: dotnet restore

src/SQLite/Top2000.Features.SQLite/Top2000.Features.SQLite.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

@@ -10,8 +10,8 @@
1010
<PackageId>RickNeeftDevelopment.Top2000App.Features.SQLite</PackageId>
1111
<Description>Top 2000 Features package using the SQLite database</Description>
1212
<Copyright>Copyright (c) Rick Neeft Development 2024</Copyright>
13-
<PackageProjectUrl>https://github.com/Top2000app/data</PackageProjectUrl>
14-
<Version>2.1.0</Version>
13+
<PackageProjectUrl>https://github.com/Top2000app/features</PackageProjectUrl>
14+
<Version>2.2.0</Version>
1515
<Authors>Rick Neeft</Authors>
1616
<Product>Top2000App</Product>
1717
<PackageIcon>nugeticon.png</PackageIcon>
@@ -27,8 +27,8 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="MediatR" Version="12.4.1" />
31-
<PackageReference Include="RickNeeftDevelopment.Top2000App.Data" Version="2.1.0" />
30+
<PackageReference Include="MediatR" Version="13.1.0" />
31+
<PackageReference Include="RickNeeftDevelopment.Top2000App.Data" Version="2.2.0" />
3232
<PackageReference Include="RickNeeftDevelopment.Top2000App.Features" Version="1.1.0" />
3333
</ItemGroup>
3434

src/Top2000.Features/Top2000.Features.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

@@ -12,7 +12,7 @@
1212
<Description>Top 2000 Features package containing the contracts for feature implementations</Description>
1313
<Copyright>Copyright (c) Rick Neeft Development 2024</Copyright>
1414
<PackageProjectUrl>https://github.com/Top2000app/data</PackageProjectUrl>
15-
<Version>1.1.0</Version>
15+
<Version>1.2.0</Version>
1616
<Authors>Rick Neeft</Authors>
1717
<Product>Top2000App</Product>
1818
<PackageIcon>nugeticon.png</PackageIcon>

tests/SQLite/Top2000.Features.SQLite.Unittests/AllEditions/EditionComparerTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Top2000.Features.AllEditions;
1+
using Top2000.Features.AllEditions;
22
using Top2000.Features.SQLite.AllEditions;
33

44
namespace Top2000.Features.SQLite.Unittests.AllEditions;
@@ -19,7 +19,7 @@ public void Editions_with_same_year_compare_as_zero()
1919
var edition1 = new Edition { Year = 2018 };
2020
var edition2 = new Edition { Year = 2018 };
2121

22-
sut.Compare(edition1, edition2).Should().Be(0);
22+
sut.Compare(edition1, edition2).ShouldBe(0);
2323
}
2424

2525
[TestMethod]
@@ -28,7 +28,7 @@ public void Edition_with_higher_year_compare_as_minus_zero()
2828
var edition1 = new Edition { Year = 2018 };
2929
var edition2 = new Edition { Year = 2019 };
3030

31-
sut.Compare(edition1, edition2).Should().Be(1);
31+
sut.Compare(edition1, edition2).ShouldBe(1);
3232
}
3333

3434
[TestMethod]
@@ -37,6 +37,6 @@ public void Edition_with_lower_year_compare_as_plus_zero()
3737
var edition1 = new Edition { Year = 2001 };
3838
var edition2 = new Edition { Year = 2000 };
3939

40-
sut.Compare(edition1, edition2).Should().Be(-1);
40+
sut.Compare(edition1, edition2).ShouldBe(-1);
4141
}
4242
}

tests/SQLite/Top2000.Features.SQLite.Unittests/AllListingsOfEdition/TrackListingComparerTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ public void TrackListingAreEqualWhenPositionIsTheSame()
1919
var track1 = new TrackListing { Position = 1 };
2020
var track2 = new TrackListing { Position = 1 };
2121

22-
sut.Equals(track1, track2).Should().BeTrue();
22+
sut.Equals(track1, track2).ShouldBeTrue();
2323
}
2424

2525
[TestMethod]
2626
public void HashCodeOfTrackListingEqualsPositionHashCode()
2727
{
2828
var track = new TrackListing { Position = 1392 };
2929

30-
sut.GetHashCode(track).Should().Be(track.Position.GetHashCode());
30+
sut.GetHashCode(track).ShouldBe(track.Position.GetHashCode());
3131
}
3232
}

tests/SQLite/Top2000.Features.SQLite.Unittests/Top2000.Features.SQLite.Unittests.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

@@ -10,15 +10,15 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="coverlet.collector" Version="6.0.2">
13+
<PackageReference Include="coverlet.collector" Version="6.0.4">
1414
<PrivateAssets>all</PrivateAssets>
1515
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1616
</PackageReference>
17-
<PackageReference Include="FluentAssertions" Version="6.12.2" />
18-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
17+
<PackageReference Include="Shouldly" Version="4.2.1" />
18+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
1919
<PackageReference Include="Moq" Version="4.20.72" />
20-
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
21-
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
20+
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
21+
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
2222
</ItemGroup>
2323

2424
<ItemGroup>

tests/SQLite/Top2000.Features.SQLite.Unittests/TrackInformation/ListingInformationDescendingComparerTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public void Listings_with_same_edition_compare_as_zero()
1414

1515
var sut = new ListingInformationDescendingComparer();
1616

17-
sut.Compare(listing1, listing2).Should().Be(0);
17+
sut.Compare(listing1, listing2).ShouldBe(0);
1818
}
1919

2020
[TestMethod]
@@ -25,7 +25,7 @@ public void Listings_with_higher_edition_compare_as_minus_zero()
2525

2626
var sut = new ListingInformationDescendingComparer();
2727

28-
sut.Compare(listing1, listing2).Should().Be(1);
28+
sut.Compare(listing1, listing2).ShouldBe(1);
2929
}
3030

3131
[TestMethod]
@@ -36,6 +36,6 @@ public void Edition_with_lower_year_compare_as_plus_zero()
3636

3737
var sut = new ListingInformationDescendingComparer();
3838

39-
sut.Compare(listing1, listing2).Should().Be(-1);
39+
sut.Compare(listing1, listing2).ShouldBe(-1);
4040
}
4141
}

tests/SQLite/Top2000.Features.SQLite.Unittests/TrackInformation/ListingStatusStrategyTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ public void Status_is_NotAvailable_when_the_track_is_not_recorded()
1818
{
1919
var listing = new ListingInformation { Edition = 2000 };
2020

21-
sut.Determine(listing).Should().Be(ListingStatus.NotAvailable);
21+
sut.Determine(listing).ShouldBe(ListingStatus.NotAvailable);
2222
}
2323

2424
[TestMethod]
2525
public void Status_is_NotListed_when_track_has_recorded_but_position_is_null()
2626
{
2727
var listing = new ListingInformation { Edition = 2002 };
2828

29-
sut.Determine(listing).Should().Be(ListingStatus.NotListed);
29+
sut.Determine(listing).ShouldBe(ListingStatus.NotListed);
3030
}
3131

3232
[TestMethod]
3333
public void Status_is_New_when_track_has_position_is_filled_and_not_been_set()
3434
{
3535
var listing = new ListingInformation { Edition = 2002, Position = 12 };
3636

37-
sut.Determine(listing).Should().Be(ListingStatus.New);
37+
sut.Determine(listing).ShouldBe(ListingStatus.New);
3838
}
3939

4040
[TestMethod]
@@ -52,7 +52,7 @@ public void Status_is_Back_when_previous_status_is_NotListed_and_new_has_been_se
5252

5353
var listing = new ListingInformation { Edition = 2004, Position = 12 };
5454

55-
sut.Determine(listing).Should().Be(ListingStatus.Back);
55+
sut.Determine(listing).ShouldBe(ListingStatus.Back);
5656
}
5757

5858
[TestMethod]
@@ -68,7 +68,7 @@ public void Status_is_Unchanged_when_offset_0()
6868
.ForEach(x => sut.Determine(x));
6969

7070
var current = new ListingInformation { Edition = 2003, Position = 2, Offset = 0 };
71-
sut.Determine(current).Should().Be(ListingStatus.Unchanged);
71+
sut.Determine(current).ShouldBe(ListingStatus.Unchanged);
7272
}
7373

7474
[TestMethod]
@@ -84,7 +84,7 @@ public void Status_is_Increased_when_offset_negative()
8484
.ForEach(x => sut.Determine(x));
8585

8686
var current = new ListingInformation { Edition = 2003, Position = 1, Offset = -1 };
87-
sut.Determine(current).Should().Be(ListingStatus.Increased);
87+
sut.Determine(current).ShouldBe(ListingStatus.Increased);
8888
}
8989

9090
[TestMethod]
@@ -100,6 +100,6 @@ public void Status_is_Decreased_when_offset_positive()
100100
.ForEach(x => sut.Determine(x));
101101

102102
var current = new ListingInformation { Edition = 2003, Position = 3, Offset = 1 };
103-
sut.Determine(current).Should().Be(ListingStatus.Decreased);
103+
sut.Determine(current).ShouldBe(ListingStatus.Decreased);
104104
}
105105
}

tests/SQLite/Top2000.Features.SQLite.Unittests/TrackInformation/TrackDetailsTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,37 +49,37 @@ public TrackDetailsTests()
4949
[TestMethod]
5050
public void First_represents_the_first_time_the_track_was_listed()
5151
{
52-
sut.First.Should().Be(listing2000);
52+
sut.First.ShouldBe(listing2000);
5353
}
5454

5555
[TestMethod]
5656
public void Highest_represents_the_first_highest_listing()
5757
{
58-
sut.Highest.Should().Be(listing2001);
58+
sut.Highest.ShouldBe(listing2001);
5959
}
6060

6161
[TestMethod]
6262
public void Lowest_represents_the_latested_lowest_listing()
6363
{
64-
sut.Lowest.Should().Be(listing2003);
64+
sut.Lowest.ShouldBe(listing2003);
6565
}
6666

6767
[TestMethod]
6868
public void Latest_represents_the_latest_listing()
6969
{
70-
sut.Latest.Should().Be(listing2004);
70+
sut.Latest.ShouldBe(listing2004);
7171
}
7272

7373
[TestMethod]
7474
public void Appearences_shows_the_counts_of_listings()
7575
{
76-
sut.Appearances.Should().Be(5);
76+
sut.Appearances.ShouldBe(5);
7777
}
7878

7979
[TestMethod]
8080
public void AppearancesPossible_shows_the_count_of_listings_possible_since_the_recorded_date()
8181
{
82-
sut.AppearancesPossible.Should().Be(6);
82+
sut.AppearancesPossible.ShouldBe(6);
8383
}
8484
}
8585
}

0 commit comments

Comments
 (0)