@@ -10,7 +10,7 @@ namespace Valkey.Glide.IntegrationTests;
1010/// </summary>
1111[ Collection ( typeof ( ServerManagementCommandTests ) ) ]
1212[ CollectionDefinition ( DisableParallelization = true ) ]
13- public class ServerManagementCommandTests ( ServerManagementFixture fixture ) : IClassFixture < ServerManagementFixture >
13+ public class ServerManagementCommandTests ( ServerManagementCommandFixture fixture ) : IClassFixture < ServerManagementCommandFixture >
1414{
1515 private GlideClient StandaloneClient => fixture . StandaloneClient ! ;
1616 private GlideClusterClient ClusterClient => fixture . ClusterClient ! ;
@@ -132,51 +132,27 @@ public async Task FlushDatabaseAsync_Cluster_WithSyncMode_AndRoute()
132132
133133 [ Fact ]
134134 public async Task LolwutAsync_Standalone_WithVersion ( )
135- {
136- string result = await StandaloneClient . LolwutAsync ( new LolwutOptions { Version = 5 } ) ;
137- Assert . NotEmpty ( result ) ;
138- Assert . Contains ( "Valkey" , result , StringComparison . OrdinalIgnoreCase ) ;
139- }
135+ => AssertContainsServerName ( await StandaloneClient . LolwutAsync ( new LolwutOptions { Version = 5 } ) ) ;
140136
141137 [ Fact ]
142138 public async Task LolwutAsync_Standalone_WithVersionAndParameters ( )
143- {
144- string result = await StandaloneClient . LolwutAsync ( new LolwutOptions { Version = 5 , Parameters = [ 40 , 20 ] } ) ;
145- Assert . NotEmpty ( result ) ;
146- Assert . Contains ( "Valkey" , result , StringComparison . OrdinalIgnoreCase ) ;
147- }
139+ => AssertContainsServerName ( await StandaloneClient . LolwutAsync ( new LolwutOptions { Version = 5 , Parameters = [ 40 , 20 ] } ) ) ;
148140
149141 [ Fact ]
150142 public async Task LolwutAsync_Cluster_WithVersion ( )
151- {
152- string result = await ClusterClient . LolwutAsync ( new LolwutOptions { Version = 5 } ) ;
153- Assert . NotEmpty ( result ) ;
154- Assert . Contains ( "Valkey" , result , StringComparison . OrdinalIgnoreCase ) ;
155- }
143+ => AssertContainsServerName ( await ClusterClient . LolwutAsync ( new LolwutOptions { Version = 5 } ) ) ;
156144
157145 [ Fact ]
158146 public async Task LolwutAsync_Cluster_WithVersionAndParameters ( )
159- {
160- string result = await ClusterClient . LolwutAsync ( new LolwutOptions { Version = 5 , Parameters = [ 40 , 20 ] } ) ;
161- Assert . NotEmpty ( result ) ;
162- Assert . Contains ( "Valkey" , result , StringComparison . OrdinalIgnoreCase ) ;
163- }
147+ => AssertContainsServerName ( await ClusterClient . LolwutAsync ( new LolwutOptions { Version = 5 , Parameters = [ 40 , 20 ] } ) ) ;
164148
165149 [ Fact ]
166150 public async Task LolwutAsync_Standalone_WithParametersOnly ( )
167- {
168- string result = await StandaloneClient . LolwutAsync ( new LolwutOptions { Parameters = [ 40 , 20 ] } ) ;
169- Assert . NotEmpty ( result ) ;
170- Assert . Contains ( "Valkey" , result , StringComparison . OrdinalIgnoreCase ) ;
171- }
151+ => AssertContainsServerName ( await StandaloneClient . LolwutAsync ( new LolwutOptions { Parameters = [ 40 , 20 ] } ) ) ;
172152
173153 [ Fact ]
174154 public async Task LolwutAsync_Cluster_WithParametersOnly ( )
175- {
176- string result = await ClusterClient . LolwutAsync ( new LolwutOptions { Parameters = [ 40 , 20 ] } ) ;
177- Assert . NotEmpty ( result ) ;
178- Assert . Contains ( "Valkey" , result , StringComparison . OrdinalIgnoreCase ) ;
179- }
155+ => AssertContainsServerName ( await ClusterClient . LolwutAsync ( new LolwutOptions { Parameters = [ 40 , 20 ] } ) ) ;
180156
181157 #endregion
182158
@@ -366,13 +342,19 @@ public async Task WaitAofAsync_Cluster_ReturnsResults()
366342 }
367343
368344 #endregion
345+
346+ /// <summary>
347+ /// Asserts that the result contains the expected server name.
348+ /// </summary>
349+ private static void AssertContainsServerName ( string result )
350+ => Assert . Contains ( [ "VALKEY" , "REDIS" ] , name => result . Contains ( name , StringComparison . OrdinalIgnoreCase ) ) ;
369351}
370352
371353/// <summary>
372354/// Fixture that provides isolated Valkey server instances for server management tests.
373355/// Tests that call FlushAll/FlushDB need their own servers to avoid interfering with other tests.
374356/// </summary>
375- public class ServerManagementFixture : IAsyncLifetime
357+ public class ServerManagementCommandFixture : IAsyncLifetime
376358{
377359 private StandaloneServer ? _standaloneServer ;
378360 private ClusterServer ? _clusterServer ;
0 commit comments