Skip to content

Commit 98bed09

Browse files
committed
Fix all build warnings
- Fixed SA1000: Added spaces after 'new' keyword - Fixed SA1009: Added spaces after closing parentheses - Fixed SA1137: Fixed indentation issues in test files - Fixed SA1413: Added trailing commas in multi-line initializers - Fixed SA1028: Removed trailing whitespace - Fixed SA1201/SA1204: Fixed member ordering in PriceProjectionBuilder - Fixed CS8618: Added default value for non-nullable PriceSize property - Fixed S2094: Added suppression for intentionally empty AccountDetailsRequest class - Fixed S1144: Removed unused private setters in HttpMessageHandlerSpy - Fixed CA1305: Used CultureInfo.InvariantCulture for ToString() calls - Fixed CA2227: Made PriceData collection property read-only - Fixed CA2213: Implemented proper disposal of disposable fields in test classes All 170+ build warnings have been resolved while maintaining full test coverage.
1 parent 23d7b02 commit 98bed09

36 files changed

+76
-71
lines changed

src/Betfair.Tests/Api/AccountDetailsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Betfair.Tests.Api;
77

88
public class AccountDetailsTests : IDisposable
99
{
10-
private readonly HttpAdapterStub _client = new();
10+
private readonly HttpAdapterStub _client = new ();
1111
private readonly BetfairApiClient _api;
1212
private bool _disposedValue;
1313

@@ -48,7 +48,7 @@ public async Task ResponseShouldBeDeserializable()
4848
Timezone = "GMT",
4949
DiscountRate = 0.05,
5050
PointsBalance = 100,
51-
CountryCode = "GB"
51+
CountryCode = "GB",
5252
};
5353
_client.RespondsWithBody = expectedResponse;
5454

src/Betfair.Tests/Api/AccountFundsTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Betfair.Api;
1+
using Betfair.Api;
22
using Betfair.Api.Requests.Account;
33
using Betfair.Api.Responses.Account;
44
using Betfair.Tests.Api.TestDoubles;
@@ -7,7 +7,7 @@ namespace Betfair.Tests.Api;
77

88
public class AccountFundsTests : IDisposable
99
{
10-
private readonly HttpAdapterStub _client = new();
10+
private readonly HttpAdapterStub _client = new ();
1111
private readonly BetfairApiClient _api;
1212
private bool _disposedValue;
1313

@@ -84,6 +84,7 @@ protected virtual void Dispose(bool disposing)
8484
{
8585
if (disposing)
8686
{
87+
_client?.Dispose();
8788
_api?.Dispose();
8889
}
8990

src/Betfair.Tests/Api/AccountStatementTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Betfair.Tests.Api;
88

99
public class AccountStatementTests : IDisposable
1010
{
11-
private readonly HttpAdapterStub _client = new();
11+
private readonly HttpAdapterStub _client = new ();
1212
private readonly BetfairApiClient _api;
1313
private bool _disposedValue;
1414

src/Betfair.Tests/Api/ApiMarketFilterTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void TodaysCardIsDefined()
4444
{
4545
var card = new ApiMarketFilter().TodaysCard();
4646

47-
card.EventTypeIds.Should().Contain(EventType.HorseRacing.Id.ToString());
47+
card.EventTypeIds.Should().Contain(EventType.HorseRacing.Id.ToString(System.Globalization.CultureInfo.InvariantCulture));
4848

4949
card.MarketTypeCodes.Should().Contain(MarketType.Win.Id);
5050
card.MarketTypes.Should().Contain(MarketType.Win.Id);

src/Betfair.Tests/Api/ClearedOrdersTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Betfair.Tests.Api;
88

99
public class ClearedOrdersTests : IDisposable
1010
{
11-
private readonly HttpAdapterStub _client = new();
11+
private readonly HttpAdapterStub _client = new ();
1212
private readonly BetfairApiClient _api;
1313
private bool _disposedValue;
1414

src/Betfair.Tests/Api/CompetitionsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Betfair.Api;
1+
using Betfair.Api;
22
using Betfair.Api.Requests;
33
using Betfair.Api.Responses;
44
using Betfair.Tests.Api.TestDoubles;

src/Betfair.Tests/Api/CurrencyRatesTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Betfair.Tests.Api;
77

88
public class CurrencyRatesTests : IDisposable
99
{
10-
private readonly HttpAdapterStub _client = new();
10+
private readonly HttpAdapterStub _client = new ();
1111
private readonly BetfairApiClient _api;
1212
private bool _disposedValue;
1313

src/Betfair.Tests/Api/FluentApiIntegrationTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ public void Dispose()
177177
protected virtual void Dispose(bool disposing)
178178
{
179179
if (_disposedValue) return;
180-
if (disposing) _api.Dispose();
180+
if (disposing)
181+
{
182+
_client?.Dispose();
183+
_api?.Dispose();
184+
}
181185
_disposedValue = true;
182186
}
183187
}

src/Betfair.Tests/Api/MarketBookTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Betfair.Tests.Api;
77

88
public class MarketBookTests : IDisposable
99
{
10-
private readonly HttpAdapterStub _client = new();
10+
private readonly HttpAdapterStub _client = new ();
1111
private readonly BetfairApiClient _api;
1212
private bool _disposedValue;
1313

src/Betfair.Tests/Api/MarketStatusTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Betfair.Api;
1+
using Betfair.Api;
22
using Betfair.Api.Responses.Markets;
33
using Betfair.Tests.Api.TestDoubles;
44

0 commit comments

Comments
 (0)