@@ -16,7 +16,7 @@ internal sealed class OddsApiClientTests
16
16
public void Constructor_WithValidDependencies_ReturnsNewInstance ( )
17
17
{
18
18
var optionsStub = Substitute . For < IOptions < OddsApiClientOptions > > ( ) ;
19
- optionsStub . Value . Returns ( new OddsApiClientOptions { Leagues = new HashSet < string > ( ) } ) ;
19
+ optionsStub . Value . Returns ( new OddsApiClientOptions { Leagues = [ ] } ) ;
20
20
var webApiClientStub = Substitute . For < IClient > ( ) ;
21
21
var keyVaultClientStub = Substitute . For < IKeyVaultClient > ( ) ;
22
22
var converterStub = Substitute . For < IOddsApiObjectConverter > ( ) ;
@@ -62,7 +62,7 @@ public void Constructor_WithNullLeaguesInOptions_ThrowsException()
62
62
public void Constructor_WithNullWebApiClient_ThrowsException ( )
63
63
{
64
64
var optionsStub = Substitute . For < IOptions < OddsApiClientOptions > > ( ) ;
65
- optionsStub . Value . Returns ( new OddsApiClientOptions { Leagues = new HashSet < string > ( ) } ) ;
65
+ optionsStub . Value . Returns ( new OddsApiClientOptions { Leagues = [ ] } ) ;
66
66
var keyVaultClientStub = Substitute . For < IKeyVaultClient > ( ) ;
67
67
var converterStub = Substitute . For < IOddsApiObjectConverter > ( ) ;
68
68
@@ -78,7 +78,7 @@ public void Constructor_WithNullWebApiClient_ThrowsException()
78
78
public void Constructor_WithNullKeyVaultClient_ThrowsException ( )
79
79
{
80
80
var optionsStub = Substitute . For < IOptions < OddsApiClientOptions > > ( ) ;
81
- optionsStub . Value . Returns ( new OddsApiClientOptions { Leagues = new HashSet < string > ( ) } ) ;
81
+ optionsStub . Value . Returns ( new OddsApiClientOptions { Leagues = [ ] } ) ;
82
82
var webApiClientStub = Substitute . For < IClient > ( ) ;
83
83
var converterStub = Substitute . For < IOddsApiObjectConverter > ( ) ;
84
84
@@ -94,7 +94,7 @@ public void Constructor_WithNullKeyVaultClient_ThrowsException()
94
94
public void Constructor_WithNullConverter_ThrowsException ( )
95
95
{
96
96
var optionsStub = Substitute . For < IOptions < OddsApiClientOptions > > ( ) ;
97
- optionsStub . Value . Returns ( new OddsApiClientOptions { Leagues = new HashSet < string > ( ) } ) ;
97
+ optionsStub . Value . Returns ( new OddsApiClientOptions { Leagues = [ ] } ) ;
98
98
var webApiClientStub = Substitute . For < IClient > ( ) ;
99
99
var keyVaultClientStub = Substitute . For < IKeyVaultClient > ( ) ;
100
100
@@ -109,15 +109,15 @@ public void Constructor_WithNullConverter_ThrowsException()
109
109
[ Test ]
110
110
public async Task GetUpcomingEventsAsync_WithLeagues_ReturnsUpcomingEvents ( )
111
111
{
112
- ICollection < Anonymous2 > rawUpcomingEvents = new HashSet < Anonymous2 > { new ( ) } ;
112
+ ICollection < Anonymous2 > rawUpcomingEvents = [ new ( ) ] ;
113
113
var webApiClientMock = Substitute . For < IClient > ( ) ;
114
114
webApiClientMock
115
115
. OddsAsync ( Arg . Any < string > ( ) , Arg . Any < string > ( ) , Arg . Any < Regions > ( ) , Arg . Any < Markets > ( ) ,
116
116
Arg . Any < DateFormat > ( ) , Arg . Any < OddsFormat > ( ) , Arg . Any < string > ( ) , Arg . Any < string > ( ) )
117
117
. Returns ( Task . FromResult ( rawUpcomingEvents ) ) ;
118
118
119
119
// ReSharper disable once CollectionNeverUpdated.Local
120
- var upcomingEvents = new List < UpcomingEvent > ( ) ;
120
+ List < UpcomingEvent > upcomingEvents = [ ] ;
121
121
var converterMock = Substitute . For < IOddsApiObjectConverter > ( ) ;
122
122
converterMock . ToUpcomingEvents ( Arg . Any < ICollection < Anonymous2 > ? > ( ) , Arg . Any < Guid > ( ) , Arg . Any < DateTime > ( ) )
123
123
. Returns ( new List < UpcomingEvent > ( ) ) ;
@@ -128,7 +128,7 @@ public async Task GetUpcomingEventsAsync_WithLeagues_ReturnsUpcomingEvents()
128
128
129
129
const string league = nameof ( league ) ;
130
130
var optionsStub = Substitute . For < IOptions < OddsApiClientOptions > > ( ) ;
131
- optionsStub . Value . Returns ( new OddsApiClientOptions { Leagues = new HashSet < string > { league } } ) ;
131
+ optionsStub . Value . Returns ( new OddsApiClientOptions { Leagues = [ league ] } ) ;
132
132
133
133
var oddsClient = new OddsApiClient ( optionsStub , webApiClientMock , keyVaultClientStub , converterMock ) ;
134
134
@@ -163,20 +163,20 @@ await webApiClientMock.Received()
163
163
[ Test ]
164
164
public async Task GetEventResultsAsync_WithLeagues_ReturnsEventResults ( )
165
165
{
166
- ICollection < Anonymous3 > rawEventResults = new HashSet < Anonymous3 > { new ( ) } ;
166
+ ICollection < Anonymous3 > rawEventResults = [ new ( ) ] ;
167
167
var webApiClientMock = Substitute . For < IClient > ( ) ;
168
168
webApiClientMock . ScoresAsync ( Arg . Any < string > ( ) , Arg . Any < string > ( ) , Arg . Any < int ? > ( ) )
169
169
. Returns ( Task . FromResult ( rawEventResults ) ) ;
170
170
171
171
// ReSharper disable once CollectionNeverUpdated.Local
172
- var eventResults = new List < EventResult > ( ) ;
172
+ List < EventResult > eventResults = [ ] ;
173
173
var converterMock = Substitute . For < IOddsApiObjectConverter > ( ) ;
174
174
converterMock . ToEventResults ( Arg . Any < ICollection < Anonymous3 > ? > ( ) , Arg . Any < Guid > ( ) , Arg . Any < DateTime > ( ) )
175
175
. Returns ( eventResults ) ;
176
176
177
177
const string league = nameof ( league ) ;
178
178
var optionsStub = Substitute . For < IOptions < OddsApiClientOptions > > ( ) ;
179
- optionsStub . Value . Returns ( new OddsApiClientOptions { Leagues = new HashSet < string > { league } } ) ;
179
+ optionsStub . Value . Returns ( new OddsApiClientOptions { Leagues = [ league ] } ) ;
180
180
181
181
const string secretValue = nameof ( secretValue ) ;
182
182
var keyVaultClientStub = Substitute . For < IKeyVaultClient > ( ) ;
0 commit comments