Skip to content

Commit

Permalink
Merge pull request #168 from AdrianJSClark/project-cleanup
Browse files Browse the repository at this point in the history
Cleanup Tasks
  • Loading branch information
AdrianJSClark authored Apr 7, 2023
2 parents 0acf282 + 21fd99c commit 21a8eb1
Show file tree
Hide file tree
Showing 27 changed files with 194 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Aydsko.iRacingData.IntegrationTests.Lookups;

internal class CachingLookupTests : CachingIntegrationFixture
internal sealed class CachingLookupTests : CachingIntegrationFixture
{
[Test(TestOf = typeof(DataClient))]
public async Task TestClubHistoryLookupsAreCachedAsync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Aydsko.iRacingData.IntegrationTests.Lookups;

internal class LookupTests : DataClientIntegrationFixture
internal sealed class LookupTests : DataClientIntegrationFixture
{
[Test]
public async Task TestClubHistoryLookupsAsync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Aydsko.iRacingData.IntegrationTests.Member;

internal class CachingMemberInfoTest : CachingIntegrationFixture
internal sealed class CachingMemberInfoTest : CachingIntegrationFixture
{
[Test]
public async Task TestMemberInfoAsync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Aydsko.iRacingData.IntegrationTests.Member;

internal class MemberInfoTest : DataClientIntegrationFixture
internal sealed class MemberInfoTest : DataClientIntegrationFixture
{
[Test]
public async Task TestMemberInfoAsync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Aydsko.iRacingData.IntegrationTests.Results;

internal class CachingResultsGetTest : CachingIntegrationFixture
internal sealed class CachingResultsGetTest : CachingIntegrationFixture
{
[Test]
public async Task GivenAValidSubsessionIdThenAResultIsReturned()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Aydsko.iRacingData.IntegrationTests.Results;

internal class CachingResultsSearchSeriesTest : CachingIntegrationFixture
internal sealed class CachingResultsSearchSeriesTest : CachingIntegrationFixture
{
[Test(TestOf = typeof(DataClient))]
public async Task GivenValidSearchParametersTheCorrectResultIsReturned()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Aydsko.iRacingData.IntegrationTests.Results;

internal class ResultsGetTest : DataClientIntegrationFixture
internal sealed class ResultsGetTest : DataClientIntegrationFixture
{
[Test]
public async Task GivenAValidSubsessionIdThenAResultIsReturned()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Aydsko.iRacingData.IntegrationTests.Results;

internal class ResultsSearchSeriesTest : DataClientIntegrationFixture
internal sealed class ResultsSearchSeriesTest : DataClientIntegrationFixture
{
[Test]
public async Task GivenValidSearchParametersTheCorrectResultIsReturned()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Aydsko.iRacingData.IntegrationTests.Tracks;

internal class CachingGetTracksTests : CachingIntegrationFixture
internal sealed class CachingGetTracksTests : CachingIntegrationFixture
{
[Test]
public async Task GetTracksTest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Aydsko.iRacingData.IntegrationTests.Tracks;

internal class GetTracksTests : DataClientIntegrationFixture
internal sealed class GetTracksTests : DataClientIntegrationFixture
{
private Track[] tracksData;

Expand Down
2 changes: 1 addition & 1 deletion src/Aydsko.iRacingData/Aydsko.iRacingData.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!-- Package Validation (https://docs.microsoft.com/en-us/dotnet/fundamentals/package-validation/overview) -->
<EnablePackageValidation>true</EnablePackageValidation>
<PackageValidationBaselineVersion>0.7.3</PackageValidationBaselineVersion>
<PackageValidationBaselineVersion>0.8.0</PackageValidationBaselineVersion>
<GenerateCompatibilitySuppressionFile>false</GenerateCompatibilitySuppressionFile>
<EnableStrictModeForCompatibleFrameworksInPackage>true</EnableStrictModeForCompatibleFrameworksInPackage>
<EnableStrictModeForCompatibleTfms>true</EnableStrictModeForCompatibleTfms>
Expand Down
2 changes: 1 addition & 1 deletion src/Aydsko.iRacingData/Common/LinkResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Aydsko.iRacingData.Common;

internal class LinkResult
internal sealed class LinkResult
{
[JsonPropertyName("link")]
public string Link { get; set; } = default!;
Expand Down
161 changes: 161 additions & 0 deletions src/Aydsko.iRacingData/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,62 @@
<Right>lib/netstandard2.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Aydsko.iRacingData.Member.MemberAward.get_CustId</Target>
<Left>lib/net6.0/Aydsko.iRacingData.dll</Left>
<Right>lib/net6.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Aydsko.iRacingData.Member.MemberAward.set_CustId(System.Int32)</Target>
<Left>lib/net6.0/Aydsko.iRacingData.dll</Left>
<Right>lib/net6.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Aydsko.iRacingData.Member.RecentAwards.get_CustId</Target>
<Left>lib/net6.0/Aydsko.iRacingData.dll</Left>
<Right>lib/net6.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Aydsko.iRacingData.Member.RecentAwards.set_CustId(System.Int32)</Target>
<Left>lib/net6.0/Aydsko.iRacingData.dll</Left>
<Right>lib/net6.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Aydsko.iRacingData.Member.MemberAward.get_CustId</Target>
<Left>lib/netstandard2.0/Aydsko.iRacingData.dll</Left>
<Right>lib/netstandard2.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Aydsko.iRacingData.Member.MemberAward.set_CustId(System.Int32)</Target>
<Left>lib/netstandard2.0/Aydsko.iRacingData.dll</Left>
<Right>lib/netstandard2.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Aydsko.iRacingData.Member.RecentAwards.get_CustId</Target>
<Left>lib/netstandard2.0/Aydsko.iRacingData.dll</Left>
<Right>lib/netstandard2.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Aydsko.iRacingData.Member.RecentAwards.set_CustId(System.Int32)</Target>
<Left>lib/netstandard2.0/Aydsko.iRacingData.dll</Left>
<Right>lib/netstandard2.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Aydsko.iRacingData.IDataClient.GetLeagueMembershipAsync(System.Int32,System.Boolean,System.Threading.CancellationToken)</Target>
Expand Down Expand Up @@ -77,4 +133,109 @@
<Right>lib/netstandard2.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.CsvStringConverter</Target>
<Left>lib/net6.0/Aydsko.iRacingData.dll</Left>
<Right>lib/net6.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.DateOnlyConverter</Target>
<Left>lib/net6.0/Aydsko.iRacingData.dll</Left>
<Right>lib/net6.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.DateTimeConverter</Target>
<Left>lib/net6.0/Aydsko.iRacingData.dll</Left>
<Right>lib/net6.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.ServiceStatusHistoryItemArrayConverter</Target>
<Left>lib/net6.0/Aydsko.iRacingData.dll</Left>
<Right>lib/net6.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.StatusTimeStampConverter</Target>
<Left>lib/net6.0/Aydsko.iRacingData.dll</Left>
<Right>lib/net6.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.StringFromStringOrNumberConverter</Target>
<Left>lib/net6.0/Aydsko.iRacingData.dll</Left>
<Right>lib/net6.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.TenThousandthSecondDurationConverter</Target>
<Left>lib/net6.0/Aydsko.iRacingData.dll</Left>
<Right>lib/net6.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.UriConverter</Target>
<Left>lib/net6.0/Aydsko.iRacingData.dll</Left>
<Right>lib/net6.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.CsvStringConverter</Target>
<Left>lib/netstandard2.0/Aydsko.iRacingData.dll</Left>
<Right>lib/netstandard2.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.DateTimeConverter</Target>
<Left>lib/netstandard2.0/Aydsko.iRacingData.dll</Left>
<Right>lib/netstandard2.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.ServiceStatusHistoryItemArrayConverter</Target>
<Left>lib/netstandard2.0/Aydsko.iRacingData.dll</Left>
<Right>lib/netstandard2.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.StatusTimeStampConverter</Target>
<Left>lib/netstandard2.0/Aydsko.iRacingData.dll</Left>
<Right>lib/netstandard2.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.StringFromStringOrNumberConverter</Target>
<Left>lib/netstandard2.0/Aydsko.iRacingData.dll</Left>
<Right>lib/netstandard2.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.TenThousandthSecondDurationConverter</Target>
<Left>lib/netstandard2.0/Aydsko.iRacingData.dll</Left>
<Right>lib/netstandard2.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Aydsko.iRacingData.Converters.UriConverter</Target>
<Left>lib/netstandard2.0/Aydsko.iRacingData.dll</Left>
<Right>lib/netstandard2.0/Aydsko.iRacingData.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
</Suppressions>
2 changes: 1 addition & 1 deletion src/Aydsko.iRacingData/Converters/CsvStringConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Aydsko.iRacingData.Converters;

public class CsvStringConverter : JsonConverter<string[]>
public sealed class CsvStringConverter : JsonConverter<string[]>
{
public override string[]? Read(ref Utf8JsonReader reader,
Type typeToConvert,
Expand Down
2 changes: 1 addition & 1 deletion src/Aydsko.iRacingData/Converters/DateOnlyConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Aydsko.iRacingData.Converters;

#if NET6_0_OR_GREATER
public class DateOnlyConverter : JsonConverter<DateOnly>
public sealed class DateOnlyConverter : JsonConverter<DateOnly>
{
public override DateOnly Read(ref Utf8JsonReader reader,
Type typeToConvert,
Expand Down
2 changes: 1 addition & 1 deletion src/Aydsko.iRacingData/Converters/DateTimeConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Aydsko.iRacingData.Converters;

public class DateTimeConverter : JsonConverter<DateTime>
public sealed class DateTimeConverter : JsonConverter<DateTime>
{
public override DateTime Read(ref Utf8JsonReader reader,
Type typeToConvert,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Aydsko.iRacingData.Converters;

public class ServiceStatusHistoryItemArrayConverter : JsonConverter<ServiceStatusHistoryItem[]>
public sealed class ServiceStatusHistoryItemArrayConverter : JsonConverter<ServiceStatusHistoryItem[]>
{
private readonly StatusTimeStampConverter StatusTimeStampConverter = new();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Aydsko.iRacingData.Converters;

public class StatusTimeStampConverter : JsonConverter<DateTimeOffset>
public sealed class StatusTimeStampConverter : JsonConverter<DateTimeOffset>
{
private static readonly DateTimeOffset Epoch = new(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@

using System.Globalization;
using System.Text.Json;
using Aydsko.iRacingData.Searches;

namespace Aydsko.iRacingData.Converters;

/// <summary>The iRacing login response contains a property that is sometimes a literal zero (0) character and sometimes a string. This converter handles this to/from a <c>string</c> value.</summary>
public class StringFromStringOrNumberConverter : JsonConverter<string>
public sealed class StringFromStringOrNumberConverter : JsonConverter<string>
{
public override string? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Aydsko.iRacingData.Converters;
/// The raw iRacing API results use a number type which carries duration values to the ten-thousandth of a second.
/// So, for example, a lap which was displayed in the iRacing results page as &quot;1:23.456&quot; would be returned as &quot;834560&quot;.
/// </summary>
public class TenThousandthSecondDurationConverter : JsonConverter<TimeSpan?>
public sealed class TenThousandthSecondDurationConverter : JsonConverter<TimeSpan?>
{
public override TimeSpan? Read(ref Utf8JsonReader reader,
Type typeToConvert,
Expand Down
2 changes: 1 addition & 1 deletion src/Aydsko.iRacingData/Converters/UriConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Aydsko.iRacingData.Converters;

public class UriConverter : JsonConverter<Uri>
public sealed class UriConverter : JsonConverter<Uri>
{
public override Uri? Read(ref Utf8JsonReader reader,
Type typeToConvert,
Expand Down
7 changes: 6 additions & 1 deletion src/Aydsko.iRacingData/LoginResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// This file is licensed to you under the MIT license.

using Aydsko.iRacingData.Converters;
using Aydsko.iRacingData.Lookups;

namespace Aydsko.iRacingData;

/// <summary>Result of a login request.</summary>
public class LoginResponse
{
[JsonPropertyName("authcode"), JsonConverter(typeof(StringFromStringOrNumberConverter))]
Expand All @@ -17,9 +17,12 @@ public class LoginResponse
[JsonPropertyName("autoLoginToken")]
public object? AutoLoginToken { get; set; }

/// <summary>Unique identifier of the customer's account.</summary>
/// <remarks>Contains <see langword="null"/> if the authentication was not successful.</remarks>
[JsonPropertyName("custId")]
public int? CustomerId { get; set; }

/// <summary>Customer's email address.</summary>
[JsonPropertyName("email")]
public string? Email { get; set; }

Expand All @@ -38,6 +41,8 @@ public class LoginResponse
[JsonPropertyName("inactive")]
public bool? IsInactive { get; set; }

/// <summary>Indicates that CAPTCHA verification is required.</summary>
/// <remarks>Authentication from this IP Address will continue to fail until the user authenticates with a browser and completes the CAPTCHA.</remarks>
[JsonPropertyName("verificationRequired")]
public bool? VerificationRequired { get; set; }

Expand Down
Loading

0 comments on commit 21a8eb1

Please sign in to comment.