@@ -11,11 +11,13 @@ namespace Momento.Sdk.Tests.Integration;
1111/// </summary>
1212public class CacheClientFixture : IDisposable
1313{
14- public ICacheClient Client { get ; private set ; }
15- public ICredentialProvider AuthProvider { get ; private set ; }
16- public string CacheName { get ; private set ; }
14+ public ICacheClient Client { get ; }
15+ public ICacheClient ClientWithConsistentReads { get ; }
16+ public ICacheClient ClientWithBalancedReads { get ; }
17+ public ICredentialProvider AuthProvider { get ; }
18+ public string CacheName { get ; }
1719
18- public TimeSpan DefaultTtl { get ; private set ; } = TimeSpan . FromSeconds ( 10 ) ;
20+ public TimeSpan DefaultTtl { get ; } = TimeSpan . FromSeconds ( 10 ) ;
1921
2022 public CacheClientFixture ( )
2123 {
@@ -35,14 +37,14 @@ public CacheClientFixture()
3537 builder . AddFilter ( "Grpc.Net.Client" , LogLevel . Error ) ;
3638 builder . SetMinimumLevel ( LogLevel . Information ) ;
3739 } ) ) ;
38-
39- if ( consistentReads )
40- {
41- config = config . WithReadConcern ( ReadConcern . Consistent ) ;
42- }
40+ var configWithConsistentReads = config . WithReadConcern ( ReadConcern . Consistent ) ;
41+
42+ ClientWithBalancedReads = new CacheClient ( config , AuthProvider , defaultTtl : DefaultTtl ) ;
43+ ClientWithConsistentReads = new CacheClient ( configWithConsistentReads , AuthProvider , defaultTtl : DefaultTtl ) ;
44+ Client = consistentReads ? ClientWithConsistentReads : ClientWithBalancedReads ;
4345
4446 CacheName = $ "dotnet-integration-{ Utils . NewGuidString ( ) } ";
45- Client = new CacheClient ( config , AuthProvider , defaultTtl : DefaultTtl ) ;
47+
4648 Utils . CreateCacheForTest ( Client , CacheName ) ;
4749 }
4850
0 commit comments