Skip to content

Commit 5c14c24

Browse files
authored
Merge pull request #65 from Afischbacher/develop
v3.7.0
2 parents 27294aa + bb04a92 commit 5c14c24

File tree

105 files changed

+2556
-1510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+2556
-1510
lines changed

.editorconfig

+7-1
Original file line numberDiff line numberDiff line change
@@ -441,4 +441,10 @@ dotnet_naming_rule.parameters_rule.severity = warning
441441
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
442442
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
443443
# OTHER DEALINGS IN THE SOFTWARE.
444-
##########################################
444+
##########################################
445+
446+
# CA1707: Identifiers should not contain underscores
447+
dotnet_diagnostic.CA1707.severity = none
448+
449+
# IDE1006: Remove warning for underscores
450+
dotnet_diagnostic.IDE1006.severity = none

.github/workflows/codeql-analysis.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,14 @@ jobs:
5151
# Prefix the list here with "+" to use these queries and those in the config file.
5252
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5353

54-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55-
# If this step fails, then you should remove it and run the build manually (see below)
56-
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v3
54+
- name: Setup .NET 9
55+
uses: actions/setup-dotnet@v1
56+
with:
57+
dotnet-version: '9.0.x'
58+
- name: Restore dependencies
59+
run: dotnet restore
60+
- name: Build
61+
run: dotnet build --no-restore --configuration Release
5862

5963
# ℹ️ Command-line programs to run using the OS shell.
6064
# 📚 https://git.io/JvXDl

.github/workflows/develop-build.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@ jobs:
1010

1111
steps:
1212
- uses: actions/checkout@v2
13-
- name: Setup .NET 8
13+
- name: Setup .NET 9
1414
uses: actions/setup-dotnet@v1
1515
with:
16-
dotnet-version: '8.0.x'
16+
dotnet-version: '9.0.x'
1717
- name: Restore dependencies
1818
run: dotnet restore
1919
- name: Build
2020
run: dotnet build --no-restore --configuration Release
2121
- name: Run Tests
22-
run: dotnet test --configuration Release --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
23-
- name: Upload coverage reports to Codecov with GitHub Action
24-
uses: codecov/codecov-action@v3
22+
run: dotnet test -m --configuration Release --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
23+
- name: Upload coverage reports to Codecov
24+
uses: codecov/codecov-action@v5
25+
with:
26+
fail_ci_if_error: false
27+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/master-build-daily.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010

1111
steps:
1212
- uses: actions/checkout@v2
13-
- name: Setup .NET 8
13+
- name: Setup .NET 9
1414
uses: actions/setup-dotnet@v1
1515
with:
16-
dotnet-version: '8.0.x'
16+
dotnet-version: '9.0.x'
1717
- name: Restore dependencies
1818
run: dotnet restore
1919
- name: Build

.github/workflows/master-build.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@ jobs:
99

1010
steps:
1111
- uses: actions/checkout@v2
12-
- name: Setup .NET 8
12+
- name: Setup .NET 9
1313
uses: actions/setup-dotnet@v1
1414
with:
15-
dotnet-version: '8.0.x'
15+
dotnet-version: '9.0.x'
1616
- name: Restore dependencies
1717
run: dotnet restore
1818
- name: Build
1919
run: dotnet build --no-restore --configuration Release
2020
- name: Run Tests
21-
run: dotnet test --configuration Release --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
22-
- name: Upload coverage reports to Codecov with GitHub Action
23-
uses: codecov/codecov-action@v3
21+
run: dotnet test -m --configuration Release --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
22+
- name: Upload coverage reports to Codecov
23+
uses: codecov/codecov-action@v5
24+
with:
25+
fail_ci_if_error: false
26+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/publish-nuget.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ jobs:
1010

1111
steps:
1212
- uses: actions/checkout@v2
13-
- name: Setup .NET 8
13+
- name: Setup .NET 9
1414
uses: actions/setup-dotnet@v1
1515
with:
16-
dotnet-version: '8.0.x'
16+
dotnet-version: '9.0.x'
1717
- name: Restore dependencies
1818
run: dotnet restore
1919
- name: Build
2020
run: dotnet build --no-restore --configuration Release
2121
- name: Run Tests
22-
run: dotnet test
22+
run: dotnet test -m
2323
- name: Deploy NuGet Package
2424
run: dotnet nuget push ../../Nhl.Api/Nhl.Api/Nhl.Api/bin/Release/*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json

Nhl.Api.Common/Exceptions/InvalidPlayerPositionException.cs

+4-8
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@ namespace Nhl.Api.Common.Exceptions;
44
/// <summary>
55
/// An exception for when a request is made to the Nhl.Api and the player/goalie position is invalid
66
/// </summary>
7-
public class InvalidPlayerPositionException : Exception
7+
/// <remarks>
8+
/// An exception for when a request is made to the Nhl.Api and the player/goalie position is invalid
9+
/// </remarks>
10+
public class InvalidPlayerPositionException(string message) : Exception(message)
811
{
9-
/// <summary>
10-
/// An exception for when a request is made to the Nhl.Api and the player/goalie position is invalid
11-
/// </summary>
12-
public InvalidPlayerPositionException(string message) : base(message)
13-
{
14-
15-
}
1612
}

Nhl.Api.Common/Exceptions/InvalidSeasonException.cs

+4-8
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@ namespace Nhl.Api.Common.Exceptions;
44
/// <summary>
55
/// An exception when the season year entered is not a valid NHL season
66
/// </summary>
7-
public class InvalidSeasonException : Exception
7+
/// <remarks>
8+
/// An exception when the season year entered is not a valid NHL season
9+
/// </remarks>
10+
public class InvalidSeasonException(string message) : Exception(message)
811
{
9-
/// <summary>
10-
/// An exception when the season year entered is not a valid NHL season
11-
/// </summary>
12-
public InvalidSeasonException(string message) : base(message)
13-
{
14-
15-
}
1612
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
3+
namespace Nhl.Api.Common.Exceptions;
4+
5+
/// <summary>
6+
/// This exception is thrown when an invalid team abbreviation is used
7+
/// </summary>
8+
public class InvalidTeamAbbreviationException(string message) : Exception
9+
{
10+
/// <summary>
11+
/// The exception message
12+
/// </summary>
13+
public override string Message => message;
14+
}

Nhl.Api.Common/Exceptions/NhlApiRequestException.cs

+4-8
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@ namespace Nhl.Api.Common.Exceptions;
44
/// <summary>
55
/// An exception for a failed Nhl.Api HTTP request
66
/// </summary>
7-
public class NhlApiRequestException : Exception
7+
/// <remarks>
8+
/// An exception for a failed Nhl.Api HTTP request
9+
/// </remarks>
10+
public class NhlApiRequestException(string message) : Exception(message)
811
{
9-
/// <summary>
10-
/// An exception for a failed Nhl.Api HTTP request
11-
/// </summary>
12-
public NhlApiRequestException(string message) : base(message)
13-
{
14-
15-
}
1612
}

Nhl.Api.Common/Extensions/EnumExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static class EnumExtensions
1515
/// <typeparam name="T">The enumeration type</typeparam>
1616
/// <param name="value">The value of the enumerations</param>
1717
/// <returns>The string value of the enumeration based on the attribute <see cref="EnumMemberAttribute"/></returns>
18-
public static string GetEnumMemberValue<T>(this T value) where T : Enum => typeof(T)
18+
public static string? GetEnumMemberValue<T>(this T value) where T : Enum => typeof(T)
1919
.GetTypeInfo()
2020
.DeclaredMembers
2121
.SingleOrDefault(x => x.Name == value.ToString())

Nhl.Api.Common/Extensions/StringExtensions.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ public static class StringExtensions
1414
public static string ReplaceNonAsciiWithAscii(this string input)
1515
{
1616
// Define a regular expression pattern for non-ASCII characters
17-
string pattern = @"[^\x00-\x7F]";
17+
var pattern = @"[^\x00-\x7F]";
1818

1919
// Replace non-ASCII characters with their ASCII equivalents
20-
string output = Regex.Replace(input, pattern, (match) =>
20+
var output = Regex.Replace(input, pattern, (match) =>
2121
{
22-
char c = match.Value[0];
22+
var c = match.Value[0];
2323
return c switch
2424
{
2525
'À' or 'Á' or 'Â' or 'Ã' or 'Ä' => "A",

0 commit comments

Comments
 (0)