File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,11 @@ protected IDatabase GetCleanDatabase(string endpointId = EndpointsFixture.Env.St
5353 return db ;
5454 }
5555
56+ protected void SkipIfTargetConnectionDoesNotExist ( string id )
57+ {
58+ Skip . IfNot ( EndpointsFixture . IsTargetConnectionExist ( id ) , $ "The connection with id '{ id } ' is not configured.") ;
59+ }
60+
5661 private List < string > keyNames = new List < string > ( ) ;
5762
5863 protected internal string CreateKeyName ( [ CallerMemberName ] string memberName = "" ) => CreateKeyNames ( 1 , memberName ) [ 0 ] ;
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ public class EndpointsFixture : IDisposable
4343 public static class Env
4444 {
4545 public const string Standalone = "standalone" ;
46+ public const string StandaloneEntraId = "standalone-entraid" ;
4647 public const string Cluster = "cluster" ;
4748
4849 public static IEnumerable < object [ ] > AllEnvironments ( )
Original file line number Diff line number Diff line change @@ -21,12 +21,14 @@ public AuthenticationTests(EndpointsFixture endpointsFixture) : base(endpointsFi
2121 [ SkippableFact ]
2222 public void TestTokenBasedAuthentication ( )
2323 {
24-
24+ // This is needed because we're constructing ConfigurationOptions in the test before calling GetConnection
25+ SkipIfTargetConnectionDoesNotExist ( EndpointsFixture . Env . StandaloneEntraId ) ;
26+
2527 var configurationOptions = new ConfigurationOptions ( ) . ConfigureForAzureWithTokenCredentialAsync ( new DefaultAzureCredential ( ) ) . Result ! ;
2628 configurationOptions . Ssl = false ;
2729 configurationOptions . AbortOnConnectFail = true ; // Fail fast for the purposes of this sample. In production code, this should remain false to retry connections on startup
2830
29- ConnectionMultiplexer ? connectionMultiplexer = GetConnection ( configurationOptions , "standalone-entraid-acl" ) ;
31+ ConnectionMultiplexer ? connectionMultiplexer = GetConnection ( configurationOptions , EndpointsFixture . Env . StandaloneEntraId ) ;
3032
3133 IDatabase db = connectionMultiplexer . GetDatabase ( ) ;
3234
You can’t perform that action at this time.
0 commit comments