From 9d492ec12289db3e939ffaa38720c535836cc208 Mon Sep 17 00:00:00 2001 From: Adrian Clark Date: Wed, 4 Sep 2024 00:50:37 +1000 Subject: [PATCH 1/4] Fix Formatting --- .../CapturedResponseValidationTests.cs | 6 +++--- .../UtcOffsetToTimeSpanArrayConverterTests.cs | 13 ++++++++++--- .../UrlExtensionsTests.cs | 10 +++++----- src/Aydsko.iRacingData/Cars/CarAssetDetail.cs | 2 +- src/Aydsko.iRacingData/Cars/CarInfo.cs | 16 ++++++++-------- src/Aydsko.iRacingData/Cars/CarRule.cs | 2 +- src/Aydsko.iRacingData/Common/CarClass.cs | 2 +- src/Aydsko.iRacingData/Common/CarsInClass.cs | 2 +- .../Converters/OneDecimalPointValueConverter.cs | 11 +++-------- .../Converters/TrackConfigNameNaConverter.cs | 4 +++- .../Converters/TwoDecimalPointsValueConverter.cs | 9 ++------- .../iRacingUnauthorizedResponseException.cs | 2 +- .../Leagues/LeagePointsSystems.cs | 4 ++-- src/Aydsko.iRacingData/Leagues/PointsSystem.cs | 6 +++--- .../Leagues/SeasonStandings.cs | 2 +- .../Leagues/SeasonStandingsDriverStandings.cs | 4 ++-- src/Aydsko.iRacingData/Leagues/Session.cs | 2 +- src/Aydsko.iRacingData/Series/ForecastOptions.cs | 16 ++++++++-------- src/Aydsko.iRacingData/Series/Seasons.cs | 4 ++-- 19 files changed, 58 insertions(+), 59 deletions(-) diff --git a/src/Aydsko.iRacingData.UnitTests/CapturedResponseValidationTests.cs b/src/Aydsko.iRacingData.UnitTests/CapturedResponseValidationTests.cs index 51b1c0a..3c77761 100644 --- a/src/Aydsko.iRacingData.UnitTests/CapturedResponseValidationTests.cs +++ b/src/Aydsko.iRacingData.UnitTests/CapturedResponseValidationTests.cs @@ -480,7 +480,7 @@ public async Task GetSeasonResultsHandlesBadRequestAsync() Assert.That(async () => { var badRequestResult = await sut.GetSeasonResultsAsync(0, Common.EventType.Race, 0, CancellationToken.None).ConfigureAwait(false); - }, Throws.Exception.InstanceOf(typeof(HttpRequestException)).And.Message.Contains("400 (Bad Request)")); + }, Throws.Exception.InstanceOf().And.Message.Contains("400 (Bad Request)")); } [Test(TestOf = typeof(DataClient))] @@ -720,7 +720,7 @@ public async Task GetSubSessionResultSuccessfulAsync() var raceResults = subSessionResult.SessionResults.Single(r => r.SimSessionName == "RACE"); Assert.That(raceResults.Results, Has.All.Property(nameof(Result.DriverResults)).Null); // Single-driver events don't have driver results. - + var sampleDriver = raceResults.Results.FirstOrDefault(r => r.Position == 0); Assert.That(sampleDriver, Is.Not.Null); Assert.That(sampleDriver!.CarClassName, Is.EqualTo("Cadillac CTS-VR")); @@ -1539,7 +1539,7 @@ public async Task GetLookupWithExpiredAuthWorksAsync() } var lookupGroups = await sut.GetLookupsAsync().ConfigureAwait(false); - Assert.ThrowsAsync(async () => await sut.GetLookupsAsync().ConfigureAwait(false)); + _ = Assert.ThrowsAsync(async () => await sut.GetLookupsAsync().ConfigureAwait(false)); var lookupGroups2 = await sut.GetLookupsAsync().ConfigureAwait(false); Assert.Multiple(() => diff --git a/src/Aydsko.iRacingData.UnitTests/Converters/UtcOffsetToTimeSpanArrayConverterTests.cs b/src/Aydsko.iRacingData.UnitTests/Converters/UtcOffsetToTimeSpanArrayConverterTests.cs index 282ef2f..1affbd1 100644 --- a/src/Aydsko.iRacingData.UnitTests/Converters/UtcOffsetToTimeSpanArrayConverterTests.cs +++ b/src/Aydsko.iRacingData.UnitTests/Converters/UtcOffsetToTimeSpanArrayConverterTests.cs @@ -29,14 +29,21 @@ public string WriteValue(TimeSpan[] input) return UTF8.GetString(result); } - public static IEnumerable ReadValueTestCases() => Examples().ToReadValueTestCases(); - public static IEnumerable WriteValueTestCases() => Examples().ToWriteValueTestCases(); + public static IEnumerable ReadValueTestCases() + { + return Examples().ToReadValueTestCases(); + } + + public static IEnumerable WriteValueTestCases() + { + return Examples().ToWriteValueTestCases(); + } private static IEnumerable<(byte[] JsonBytes, TimeSpan[] Value, string Name)> Examples() { yield return (@"{""value"":[0,0]}"u8.ToArray(), [TimeSpan.Zero, TimeSpan.Zero], "Value [0,0] returns [TimeSpan.Zero,TimeSpan.Zero]"); yield return (@"{""value"":[-240]}"u8.ToArray(), [TimeSpan.FromHours(-4)], "Value [-240] returns [TimeSpan.FromHours(-4)]"); - yield return (@"{""value"":[240,0]}"u8.ToArray(), [TimeSpan.FromHours(4),TimeSpan.Zero], "Value [240,0] returns [TimeSpan.FromHours(4),TimeSpan.Zero]"); + yield return (@"{""value"":[240,0]}"u8.ToArray(), [TimeSpan.FromHours(4), TimeSpan.Zero], "Value [240,0] returns [TimeSpan.FromHours(4),TimeSpan.Zero]"); yield return (@"{""value"":[630]}"u8.ToArray(), [TimeSpan.FromHours(10.5)], "Value [630] returns [TimeSpan.FromHours(10.5)]"); } } diff --git a/src/Aydsko.iRacingData.UnitTests/UrlExtensionsTests.cs b/src/Aydsko.iRacingData.UnitTests/UrlExtensionsTests.cs index 9645119..113ae17 100644 --- a/src/Aydsko.iRacingData.UnitTests/UrlExtensionsTests.cs +++ b/src/Aydsko.iRacingData.UnitTests/UrlExtensionsTests.cs @@ -11,12 +11,12 @@ public Uri ValidateToUrlWithQueryMethod(string url, IEnumerable ValidateToUrlWithQueryMethodTestCases() { yield return new TestCaseData("https://example.com", Array.Empty>()) { ExpectedResult = new Uri("https://example.com") }; - yield return new TestCaseData("https://example.com", new KeyValuePair[] { new("foo", "bar" ) }) { ExpectedResult = new Uri("https://example.com?foo=bar") }; + yield return new TestCaseData("https://example.com", new KeyValuePair[] { new("foo", "bar") }) { ExpectedResult = new Uri("https://example.com?foo=bar") }; #pragma warning disable CA1861 // Avoid constant arrays as arguments - yield return new TestCaseData("https://example.com", new KeyValuePair[] { new("foo", new[] { "bar", "baz" } ) }) { ExpectedResult = new Uri("https://example.com?foo=bar,baz") }; + yield return new TestCaseData("https://example.com", new KeyValuePair[] { new("foo", new[] { "bar", "baz" }) }) { ExpectedResult = new Uri("https://example.com?foo=bar,baz") }; #pragma warning restore CA1861 // Avoid constant arrays as arguments - yield return new TestCaseData("https://example.com", new KeyValuePair[] { new("=&?", "=?&=?&" ) }) { ExpectedResult = new Uri("https://example.com?%3D%26%3F=%3D%3F%26%3D%3F%26") }; - yield return new TestCaseData("https://example.com", new KeyValuePair[] { new("foo", "bar" ), new("baz", "bat" ) }) { ExpectedResult = new Uri("https://example.com?foo=bar&baz=bat") }; - yield return new TestCaseData("https://example.com?a=b", new KeyValuePair[] { new("foo", "bar" ), new("baz", "bat" ) }) { ExpectedResult = new Uri("https://example.com?a=b&foo=bar&baz=bat") }; + yield return new TestCaseData("https://example.com", new KeyValuePair[] { new("=&?", "=?&=?&") }) { ExpectedResult = new Uri("https://example.com?%3D%26%3F=%3D%3F%26%3D%3F%26") }; + yield return new TestCaseData("https://example.com", new KeyValuePair[] { new("foo", "bar"), new("baz", "bat") }) { ExpectedResult = new Uri("https://example.com?foo=bar&baz=bat") }; + yield return new TestCaseData("https://example.com?a=b", new KeyValuePair[] { new("foo", "bar"), new("baz", "bat") }) { ExpectedResult = new Uri("https://example.com?a=b&foo=bar&baz=bat") }; } } diff --git a/src/Aydsko.iRacingData/Cars/CarAssetDetail.cs b/src/Aydsko.iRacingData/Cars/CarAssetDetail.cs index 0a20260..d776413 100644 --- a/src/Aydsko.iRacingData/Cars/CarAssetDetail.cs +++ b/src/Aydsko.iRacingData/Cars/CarAssetDetail.cs @@ -12,7 +12,7 @@ public class CarAssetDetail [JsonPropertyName("car_id")] public int CarId { get; set; } - [JsonPropertyName("car_rules")] + [JsonPropertyName("car_rules")] public CarRule[] CarRules { get; set; } = default!; [JsonPropertyName("detail_copy")] diff --git a/src/Aydsko.iRacingData/Cars/CarInfo.cs b/src/Aydsko.iRacingData/Cars/CarInfo.cs index 97ff262..7fda322 100644 --- a/src/Aydsko.iRacingData/Cars/CarInfo.cs +++ b/src/Aydsko.iRacingData/Cars/CarInfo.cs @@ -55,9 +55,9 @@ public class CarInfo [JsonPropertyName("first_sale")] public DateTimeOffset FirstSale { get; set; } - [JsonPropertyName("forum_url")] + [JsonPropertyName("forum_url")] public string ForumUrl { get; set; } = default!; - + [JsonPropertyName("free_with_subscription")] public bool FreeWithSubscription { get; set; } @@ -66,13 +66,13 @@ public class CarInfo [JsonPropertyName("has_multiple_dry_tire_types")] public bool HasMultipleDryTireTypes { get; set; } - + [JsonPropertyName("has_rain_capable_tire_types")] public bool HasRainCapableTireTypes { get; set; } [JsonPropertyName("hp")] public int Hp { get; set; } - + [JsonPropertyName("is_ps_purchasable")] public bool IsPsPurchasable { get; set; } @@ -93,8 +93,8 @@ public class CarInfo [JsonPropertyName("price")] public float Price { get; set; } - - [JsonPropertyName("price_display")] + + [JsonPropertyName("price_display")] public string PriceDisplay { get; set; } = default!; [JsonPropertyName("retired")] @@ -117,8 +117,8 @@ public class CarInfo [JsonPropertyName("site_url"), JsonConverter(typeof(UriConverter))] public Uri? SiteUrl { get; set; } = default!; - - [JsonPropertyName("rain_enabled")] + + [JsonPropertyName("rain_enabled")] public bool RainEnabled { get; set; } } diff --git a/src/Aydsko.iRacingData/Cars/CarRule.cs b/src/Aydsko.iRacingData/Cars/CarRule.cs index 37bdee0..20b1dd2 100644 --- a/src/Aydsko.iRacingData/Cars/CarRule.cs +++ b/src/Aydsko.iRacingData/Cars/CarRule.cs @@ -4,7 +4,7 @@ public class CarRule { [JsonPropertyName("rule_category")] public string RuleCategory { get; set; } = default!; - + [JsonPropertyName("text")] public string Text { get; set; } = default!; } diff --git a/src/Aydsko.iRacingData/Common/CarClass.cs b/src/Aydsko.iRacingData/Common/CarClass.cs index c9758a9..8bdb305 100644 --- a/src/Aydsko.iRacingData/Common/CarClass.cs +++ b/src/Aydsko.iRacingData/Common/CarClass.cs @@ -19,7 +19,7 @@ public class CarClass [JsonPropertyName("rain_enabled")] public bool RainEnabled { get; set; } - + [JsonPropertyName("relative_speed")] public int RelativeSpeed { get; set; } diff --git a/src/Aydsko.iRacingData/Common/CarsInClass.cs b/src/Aydsko.iRacingData/Common/CarsInClass.cs index 8e4f0c3..3ce5ec9 100644 --- a/src/Aydsko.iRacingData/Common/CarsInClass.cs +++ b/src/Aydsko.iRacingData/Common/CarsInClass.cs @@ -13,7 +13,7 @@ public class CarsInClass [JsonPropertyName("rain_enabled")] public bool RainEnabled { get; set; } - + [JsonPropertyName("retired")] public bool Retired { get; set; } } diff --git a/src/Aydsko.iRacingData/Converters/OneDecimalPointValueConverter.cs b/src/Aydsko.iRacingData/Converters/OneDecimalPointValueConverter.cs index 065122a..c192a73 100644 --- a/src/Aydsko.iRacingData/Converters/OneDecimalPointValueConverter.cs +++ b/src/Aydsko.iRacingData/Converters/OneDecimalPointValueConverter.cs @@ -9,12 +9,7 @@ public class OneDecimalPointValueConverter : JsonConverter { public override decimal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - if (reader.TryGetInt32(out var intValue)) - { - return intValue / 10m; - } - - return default; + return reader.TryGetInt32(out var intValue) ? intValue / 10m : default; } public override void Write(Utf8JsonWriter writer, decimal value, JsonSerializerOptions options) @@ -27,7 +22,7 @@ public override void Write(Utf8JsonWriter writer, decimal value, JsonSerializerO throw new ArgumentNullException(nameof(writer)); } #endif - + writer.WriteNumberValue(value * 10); } -} \ No newline at end of file +} diff --git a/src/Aydsko.iRacingData/Converters/TrackConfigNameNaConverter.cs b/src/Aydsko.iRacingData/Converters/TrackConfigNameNaConverter.cs index f033f6a..2768176 100644 --- a/src/Aydsko.iRacingData/Converters/TrackConfigNameNaConverter.cs +++ b/src/Aydsko.iRacingData/Converters/TrackConfigNameNaConverter.cs @@ -9,13 +9,15 @@ internal class TrackConfigNameNaConverter : JsonConverter { public override string? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { +#pragma warning disable IDE0072 // Add missing cases - Correct behaviour is already the default case var value = reader.TokenType switch { JsonTokenType.String => reader.GetString(), _ => null }; +#pragma warning restore IDE0072 // Add missing cases - return string.IsNullOrWhiteSpace(value) || string.Equals(value, "N/A", StringComparison.OrdinalIgnoreCase) ? null : value; + return string.IsNullOrWhiteSpace(value) || string.Equals(value, "N/A", StringComparison.OrdinalIgnoreCase) ? null : value; } public override void Write(Utf8JsonWriter writer, string? value, JsonSerializerOptions options) diff --git a/src/Aydsko.iRacingData/Converters/TwoDecimalPointsValueConverter.cs b/src/Aydsko.iRacingData/Converters/TwoDecimalPointsValueConverter.cs index 0e07167..3abdd97 100644 --- a/src/Aydsko.iRacingData/Converters/TwoDecimalPointsValueConverter.cs +++ b/src/Aydsko.iRacingData/Converters/TwoDecimalPointsValueConverter.cs @@ -9,12 +9,7 @@ public class TwoDecimalPointsValueConverter : JsonConverter { public override decimal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - if (reader.TryGetInt32(out var intValue)) - { - return intValue / 100m; - } - - return default; + return reader.TryGetInt32(out var intValue) ? intValue / 100m : default; } public override void Write(Utf8JsonWriter writer, decimal value, JsonSerializerOptions options) @@ -27,7 +22,7 @@ public override void Write(Utf8JsonWriter writer, decimal value, JsonSerializerO throw new ArgumentNullException(nameof(writer)); } #endif - + writer.WriteNumberValue(value * 100); } } diff --git a/src/Aydsko.iRacingData/Exceptions/iRacingUnauthorizedResponseException.cs b/src/Aydsko.iRacingData/Exceptions/iRacingUnauthorizedResponseException.cs index c405485..66d7170 100644 --- a/src/Aydsko.iRacingData/Exceptions/iRacingUnauthorizedResponseException.cs +++ b/src/Aydsko.iRacingData/Exceptions/iRacingUnauthorizedResponseException.cs @@ -10,7 +10,7 @@ public class iRacingUnauthorizedResponseException : iRacingDataClientException { public static iRacingUnauthorizedResponseException Create(string? message) { - return new($"The iRacing API returned an \"Unauthorized\" response code{(string.IsNullOrEmpty(message)?"":" with message \"" + message + "\"")}."); + return new($"The iRacing API returned an \"Unauthorized\" response code{(string.IsNullOrEmpty(message) ? "" : " with message \"" + message + "\"")}."); } public iRacingUnauthorizedResponseException() diff --git a/src/Aydsko.iRacingData/Leagues/LeagePointsSystems.cs b/src/Aydsko.iRacingData/Leagues/LeagePointsSystems.cs index b9896bf..5583b09 100644 --- a/src/Aydsko.iRacingData/Leagues/LeagePointsSystems.cs +++ b/src/Aydsko.iRacingData/Leagues/LeagePointsSystems.cs @@ -7,10 +7,10 @@ public class LeagePointsSystems { [JsonPropertyName("subscribed")] public bool Subscribed { get; set; } - + [JsonPropertyName("success")] public bool Success { get; set; } - + [JsonPropertyName("points_systems")] public PointsSystem[] PointsSystems { get; set; } = default!; diff --git a/src/Aydsko.iRacingData/Leagues/PointsSystem.cs b/src/Aydsko.iRacingData/Leagues/PointsSystem.cs index 35dd1f8..5c3f948 100644 --- a/src/Aydsko.iRacingData/Leagues/PointsSystem.cs +++ b/src/Aydsko.iRacingData/Leagues/PointsSystem.cs @@ -7,16 +7,16 @@ public class PointsSystem [JsonPropertyName("name")] public string Name { get; set; } = default!; - + [JsonPropertyName("description")] public string Description { get; set; } = default!; [JsonPropertyName("league_id")] public int LeagueId { get; set; } - + [JsonPropertyName("retired")] public bool Retired { get; set; } - + [JsonPropertyName("iracing_system")] public bool IRacingSystem { get; set; } } diff --git a/src/Aydsko.iRacingData/Leagues/SeasonStandings.cs b/src/Aydsko.iRacingData/Leagues/SeasonStandings.cs index e969641..c07f6d8 100644 --- a/src/Aydsko.iRacingData/Leagues/SeasonStandings.cs +++ b/src/Aydsko.iRacingData/Leagues/SeasonStandings.cs @@ -12,7 +12,7 @@ public class SeasonStandings public bool Success { get; set; } [JsonPropertyName("season_id")] - public int SeasonId{ get; set; } + public int SeasonId { get; set; } [JsonPropertyName("car_id")] public int CarId { get; set; } diff --git a/src/Aydsko.iRacingData/Leagues/SeasonStandingsDriverStandings.cs b/src/Aydsko.iRacingData/Leagues/SeasonStandingsDriverStandings.cs index cc1d0c7..060b9cd 100644 --- a/src/Aydsko.iRacingData/Leagues/SeasonStandingsDriverStandings.cs +++ b/src/Aydsko.iRacingData/Leagues/SeasonStandingsDriverStandings.cs @@ -6,8 +6,8 @@ namespace Aydsko.iRacingData.Leagues; public class SeasonStandingsDriverStandings { [JsonPropertyName("rownum")] - public int RowNumber{ get; set; } - + public int RowNumber { get; set; } + [JsonPropertyName("position")] public int Position { get; set; } diff --git a/src/Aydsko.iRacingData/Leagues/Session.cs b/src/Aydsko.iRacingData/Leagues/Session.cs index 10c4660..53decae 100644 --- a/src/Aydsko.iRacingData/Leagues/Session.cs +++ b/src/Aydsko.iRacingData/Leagues/Session.cs @@ -21,7 +21,7 @@ public class Session public bool DoNotPaintCars { get; set; } [JsonPropertyName("driver_changes")] - public bool DriverChanges { get; set; } + public bool DriverChanges { get; set; } [JsonPropertyName("entry_count")] public int EntryCount { get; set; } diff --git a/src/Aydsko.iRacingData/Series/ForecastOptions.cs b/src/Aydsko.iRacingData/Series/ForecastOptions.cs index cee7847..2860455 100644 --- a/src/Aydsko.iRacingData/Series/ForecastOptions.cs +++ b/src/Aydsko.iRacingData/Series/ForecastOptions.cs @@ -4,25 +4,25 @@ public class ForecastOptions { [JsonPropertyName("forecast_type")] public int ForecastType { get; set; } - + [JsonPropertyName("precipitation")] public int Precipitation { get; set; } - + [JsonPropertyName("skies")] public int Skies { get; set; } - + [JsonPropertyName("stop_precip")] public int StopPrecip { get; set; } - + [JsonPropertyName("temperature")] public int Temperature { get; set; } - + [JsonPropertyName("weather_seed")] public long WeatherSeed { get; set; } - + [JsonPropertyName("wind_dir")] public int WindDir { get; set; } - + [JsonPropertyName("wind_speed")] public int WindSpeed { get; set; } -} \ No newline at end of file +} diff --git a/src/Aydsko.iRacingData/Series/Seasons.cs b/src/Aydsko.iRacingData/Series/Seasons.cs index 5a09214..55b78ad 100644 --- a/src/Aydsko.iRacingData/Series/Seasons.cs +++ b/src/Aydsko.iRacingData/Series/Seasons.cs @@ -169,8 +169,8 @@ public class SeasonSeries [JsonPropertyName("heat_ses_info")] public HeatSessionInfo HeatSesInfo { get; set; } = default!; - - [JsonPropertyName("hardcore_level")] + + [JsonPropertyName("hardcore_level")] public int HardcoreLevel { get; set; } [JsonPropertyName("has_supersessions")] From 2e93b84674177eeb03e76fc6354bf88d48ad3c09 Mon Sep 17 00:00:00 2001 From: Adrian Clark Date: Wed, 4 Sep 2024 01:00:41 +1000 Subject: [PATCH 2/4] Rename "LeagePointsSystems" to "LeaguePointsSystems" --- .../CompatibilitySuppressions.xml | 77 +++++++++++++++++++ src/Aydsko.iRacingData/DataClient.cs | 4 +- src/Aydsko.iRacingData/IDataClient.cs | 4 +- ...ointsSystems.cs => LeaguePointsSystems.cs} | 6 +- .../Package Release Notes.txt | 8 +- 5 files changed, 91 insertions(+), 8 deletions(-) rename src/Aydsko.iRacingData/Leagues/{LeagePointsSystems.cs => LeaguePointsSystems.cs} (69%) diff --git a/src/Aydsko.iRacingData/CompatibilitySuppressions.xml b/src/Aydsko.iRacingData/CompatibilitySuppressions.xml index b88b35c..d192990 100644 --- a/src/Aydsko.iRacingData/CompatibilitySuppressions.xml +++ b/src/Aydsko.iRacingData/CompatibilitySuppressions.xml @@ -1,12 +1,40 @@  + + CP0001 + T:Aydsko.iRacingData.Leagues.LeagePointsSystems + lib/net6.0/Aydsko.iRacingData.dll + lib/net6.0/Aydsko.iRacingData.dll + true + + + CP0001 + T:Aydsko.iRacingData.Leagues.LeagePointsSystems + lib/net8.0/Aydsko.iRacingData.dll + lib/net8.0/Aydsko.iRacingData.dll + true + CP0001 T:Aydsko.iRacingData.Converters.DateOnlyConverter lib/netstandard2.0/Aydsko.iRacingData.dll lib/net6.0/Aydsko.iRacingData.dll + + CP0001 + T:Aydsko.iRacingData.Leagues.LeagePointsSystems + lib/netstandard2.0/Aydsko.iRacingData.dll + lib/netstandard2.0/Aydsko.iRacingData.dll + true + + + CP0002 + M:Aydsko.iRacingData.DataClient.GetLeaguePointsSystemsAsync(System.Int32,System.Nullable{System.Int32},System.Threading.CancellationToken) + lib/net6.0/Aydsko.iRacingData.dll + lib/net6.0/Aydsko.iRacingData.dll + true + CP0002 M:Aydsko.iRacingData.Hosted.Car.get_PowerAdjustPercent @@ -14,6 +42,20 @@ lib/net6.0/Aydsko.iRacingData.dll true + + CP0002 + M:Aydsko.iRacingData.IDataClient.GetLeaguePointsSystemsAsync(System.Int32,System.Nullable{System.Int32},System.Threading.CancellationToken) + lib/net6.0/Aydsko.iRacingData.dll + lib/net6.0/Aydsko.iRacingData.dll + true + + + CP0002 + M:Aydsko.iRacingData.DataClient.GetLeaguePointsSystemsAsync(System.Int32,System.Nullable{System.Int32},System.Threading.CancellationToken) + lib/net8.0/Aydsko.iRacingData.dll + lib/net8.0/Aydsko.iRacingData.dll + true + CP0002 M:Aydsko.iRacingData.Hosted.Car.get_PowerAdjustPercent @@ -21,6 +63,13 @@ lib/net8.0/Aydsko.iRacingData.dll true + + CP0002 + M:Aydsko.iRacingData.IDataClient.GetLeaguePointsSystemsAsync(System.Int32,System.Nullable{System.Int32},System.Threading.CancellationToken) + lib/net8.0/Aydsko.iRacingData.dll + lib/net8.0/Aydsko.iRacingData.dll + true + CP0002 M:Aydsko.iRacingData.Member.MemberChartDataPoint.get_Day @@ -87,6 +136,13 @@ lib/netstandard2.0/Aydsko.iRacingData.dll lib/net6.0/Aydsko.iRacingData.dll + + CP0002 + M:Aydsko.iRacingData.DataClient.GetLeaguePointsSystemsAsync(System.Int32,System.Nullable{System.Int32},System.Threading.CancellationToken) + lib/netstandard2.0/Aydsko.iRacingData.dll + lib/netstandard2.0/Aydsko.iRacingData.dll + true + CP0002 M:Aydsko.iRacingData.Hosted.Car.get_PowerAdjustPercent @@ -94,6 +150,27 @@ lib/netstandard2.0/Aydsko.iRacingData.dll true + + CP0002 + M:Aydsko.iRacingData.IDataClient.GetLeaguePointsSystemsAsync(System.Int32,System.Nullable{System.Int32},System.Threading.CancellationToken) + lib/netstandard2.0/Aydsko.iRacingData.dll + lib/netstandard2.0/Aydsko.iRacingData.dll + true + + + CP0006 + M:Aydsko.iRacingData.IDataClient.GetLeaguePointsSystemsAsync(System.Int32,System.Nullable{System.Int32},System.Threading.CancellationToken) + lib/net8.0/Aydsko.iRacingData.dll + lib/net8.0/Aydsko.iRacingData.dll + true + + + CP0006 + M:Aydsko.iRacingData.IDataClient.GetLeaguePointsSystemsAsync(System.Int32,System.Nullable{System.Int32},System.Threading.CancellationToken) + lib/netstandard2.0/Aydsko.iRacingData.dll + lib/netstandard2.0/Aydsko.iRacingData.dll + true + CP0008 T:Aydsko.iRacingData.Common.EventType diff --git a/src/Aydsko.iRacingData/DataClient.cs b/src/Aydsko.iRacingData/DataClient.cs index 3634930..9d2068d 100644 --- a/src/Aydsko.iRacingData/DataClient.cs +++ b/src/Aydsko.iRacingData/DataClient.cs @@ -191,7 +191,7 @@ public async Task> GetLeagueAsync(int leagueId, bool includ } /// - public async Task> GetLeaguePointsSystemsAsync(int leagueId, int? seasonId = null, CancellationToken cancellationToken = default) + public async Task> GetLeaguePointsSystemsAsync(int leagueId, int? seasonId = null, CancellationToken cancellationToken = default) { await EnsureLoggedInAsync(cancellationToken).ConfigureAwait(false); @@ -207,7 +207,7 @@ public async Task> GetLeaguePointsSystemsAsync( var queryUrl = "https://members-ng.iracing.com/data/league/get_points_systems".ToUrlWithQuery(queryParameters); - return await CreateResponseViaInfoLinkAsync(queryUrl, LeagePointsSystemsContext.Default.LeagePointsSystems, cancellationToken).ConfigureAwait(false); + return await CreateResponseViaInfoLinkAsync(queryUrl, LeaguePointsSystemsContext.Default.LeaguePointsSystems, cancellationToken).ConfigureAwait(false); } /// diff --git a/src/Aydsko.iRacingData/IDataClient.cs b/src/Aydsko.iRacingData/IDataClient.cs index 9ff6e54..aee186a 100644 --- a/src/Aydsko.iRacingData/IDataClient.cs +++ b/src/Aydsko.iRacingData/IDataClient.cs @@ -221,11 +221,11 @@ public interface IDataClient /// The unique identifier for the league. /// If included and the season is using custom points then the custom points option is included in the returned list. Otherwise the custom points option is not returned. /// A token to allow the operation to be cancelled. - /// A containing the league point system information in a object. + /// A containing the league point system information in a object. /// If the client is not currently authenticated. /// If there's a problem processing the result. /// If the iRacing API returns a 401 Unauthorized response. - Task> GetLeaguePointsSystemsAsync(int leagueId, int? seasonId = null, CancellationToken cancellationToken = default); + Task> GetLeaguePointsSystemsAsync(int leagueId, int? seasonId = null, CancellationToken cancellationToken = default); /// Information about license levels available in the iRacing system. /// A token to allow the operation to be cancelled. diff --git a/src/Aydsko.iRacingData/Leagues/LeagePointsSystems.cs b/src/Aydsko.iRacingData/Leagues/LeaguePointsSystems.cs similarity index 69% rename from src/Aydsko.iRacingData/Leagues/LeagePointsSystems.cs rename to src/Aydsko.iRacingData/Leagues/LeaguePointsSystems.cs index 5583b09..44ab40c 100644 --- a/src/Aydsko.iRacingData/Leagues/LeagePointsSystems.cs +++ b/src/Aydsko.iRacingData/Leagues/LeaguePointsSystems.cs @@ -3,7 +3,7 @@ namespace Aydsko.iRacingData.Leagues; -public class LeagePointsSystems +public class LeaguePointsSystems { [JsonPropertyName("subscribed")] public bool Subscribed { get; set; } @@ -18,6 +18,6 @@ public class LeagePointsSystems public int LeagueId { get; set; } } -[JsonSerializable(typeof(LeagePointsSystems)), JsonSourceGenerationOptions(WriteIndented = true)] -internal partial class LeagePointsSystemsContext : JsonSerializerContext +[JsonSerializable(typeof(LeaguePointsSystems)), JsonSourceGenerationOptions(WriteIndented = true)] +internal partial class LeaguePointsSystemsContext : JsonSerializerContext { } diff --git a/src/Aydsko.iRacingData/Package Release Notes.txt b/src/Aydsko.iRacingData/Package Release Notes.txt index 4d7e1b6..253ce38 100644 --- a/src/Aydsko.iRacingData/Package Release Notes.txt +++ b/src/Aydsko.iRacingData/Package Release Notes.txt @@ -1,3 +1,9 @@ -Fixes / Changes: +BREAKING CHANGES: + +- "LeagePointsSystems" class has been renamed to "LeaguePointsSystem" + + + +Fixes / Changes: - Error when use function ListHostedSessionsCombinedAsync and ListHostedSessionsAsync (Issue #219) From a56ceebe03c2cadb091cab8b2192be832e0596de Mon Sep 17 00:00:00 2001 From: Adrian Clark Date: Wed, 4 Sep 2024 01:00:57 +1000 Subject: [PATCH 3/4] Fix Keyword Ordering --- src/Aydsko.iRacingData/Extensions.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Aydsko.iRacingData/Extensions.cs b/src/Aydsko.iRacingData/Extensions.cs index 8cddb0e..9223ebb 100644 --- a/src/Aydsko.iRacingData/Extensions.cs +++ b/src/Aydsko.iRacingData/Extensions.cs @@ -15,14 +15,14 @@ namespace Aydsko.iRacingData; -static internal class Extensions +internal static class Extensions { /// Add the parameter with the property's as the key and it's value if that value is not null. /// Type of the property. /// Collection of parameters to add to. /// An expression which accesses the property. /// The expression couldn't be properly understood by the method. - static internal void AddParameterIfNotNull(this IDictionary parameters, Expression> parameter) + internal static void AddParameterIfNotNull(this IDictionary parameters, Expression> parameter) { #if (NET6_0_OR_GREATER) ArgumentNullException.ThrowIfNull(parameter); @@ -55,7 +55,7 @@ static internal void AddParameterIfNotNull(this IDictionary parameters.Add(new(parameterName, parameterValue)); } - static internal Uri ToUrlWithQuery(this string url, IEnumerable> parameters) + internal static Uri ToUrlWithQuery(this string url, IEnumerable> parameters) { var builder = new UriBuilder(url); @@ -152,7 +152,7 @@ static IEnumerable GetNonNullValues(Array array) #if (NET6_0_OR_GREATER == false) [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1304:Specify CultureInfo", Justification = "")] - static internal CookieCollection GetAllCookies(this CookieContainer container) + internal static CookieCollection GetAllCookies(this CookieContainer container) { var result = new CookieCollection(); From c9fa495764ee5c46d9fcbc45775b77431fcf8cd2 Mon Sep 17 00:00:00 2001 From: Adrian Clark Date: Wed, 4 Sep 2024 01:08:59 +1000 Subject: [PATCH 4/4] Update NuGet Packages --- .../Aydsko.iRacingData.IntegrationTests.csproj | 8 ++++---- .../Aydsko.iRacingData.UnitTests.csproj | 8 ++++---- src/Aydsko.iRacingData/Aydsko.iRacingData.csproj | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Aydsko.iRacingData.IntegrationTests/Aydsko.iRacingData.IntegrationTests.csproj b/src/Aydsko.iRacingData.IntegrationTests/Aydsko.iRacingData.IntegrationTests.csproj index 1ce01ef..01e3ade 100644 --- a/src/Aydsko.iRacingData.IntegrationTests/Aydsko.iRacingData.IntegrationTests.csproj +++ b/src/Aydsko.iRacingData.IntegrationTests/Aydsko.iRacingData.IntegrationTests.csproj @@ -14,14 +14,14 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Aydsko.iRacingData.UnitTests/Aydsko.iRacingData.UnitTests.csproj b/src/Aydsko.iRacingData.UnitTests/Aydsko.iRacingData.UnitTests.csproj index a936fcc..56dfec9 100644 --- a/src/Aydsko.iRacingData.UnitTests/Aydsko.iRacingData.UnitTests.csproj +++ b/src/Aydsko.iRacingData.UnitTests/Aydsko.iRacingData.UnitTests.csproj @@ -8,13 +8,13 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Aydsko.iRacingData/Aydsko.iRacingData.csproj b/src/Aydsko.iRacingData/Aydsko.iRacingData.csproj index 94bf66b..67b135e 100644 --- a/src/Aydsko.iRacingData/Aydsko.iRacingData.csproj +++ b/src/Aydsko.iRacingData/Aydsko.iRacingData.csproj @@ -76,7 +76,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive