Exemple #1
0
        private static void CheckAuthentication(AuthenticationRequirement authentication)
        {
            switch (authentication)
            {
            case AuthenticationRequirement.Off:
                if (CoreTestConfiguration.ConnectionString.Username != null)
                {
                    throw new SkipTestException("Test skipped because authentication is on.");
                }
                return;

            case AuthenticationRequirement.On:
                if (CoreTestConfiguration.ConnectionString.Username == null)
                {
                    throw new SkipTestException("Test skipped because authentication is off.");
                }
                return;

            case AuthenticationRequirement.Unspecified:
                return;

            default:
                throw new ArgumentException($"Invalid authentication requirement: {authentication}.", nameof(authentication));
            }
        }
Exemple #2
0
 public static void Where(
     AuthenticationRequirement? authentication = null,
     ClusterTypes? clusterTypes = null,
     string minimumVersion = null,
     string modules = null,
     string storageEngines = null,
     string versionLessThan = null
     )
 {
     Any();
     if (minimumVersion != null)
     {
         CheckMinimumVersion(minimumVersion);
     }
     if (versionLessThan != null)
     {
         CheckVersionLessThan(versionLessThan);
     }
     if (clusterTypes != null)
     {
         CheckClusterTypes(clusterTypes.Value);
     }
     if (modules != null)
     {
         CheckModules(modules);
     }
     if (storageEngines != null)
     {
         CheckStorageEngines(storageEngines);
     }
     if (authentication != null)
     {
         CheckAuthentication(authentication.Value);
     }
 }
Exemple #3
0
 public MyAuthAttribute(AuthenticationRequirement requirement)
 {
     _requirement = requirement;
 }
Exemple #4
0
 private static void CheckAuthentication(AuthenticationRequirement authentication)
 {
     switch (authentication)
     {
         case AuthenticationRequirement.Off:
             if (CoreTestConfiguration.ConnectionString.Username != null)
             {
                 throw new SkipTestException("Test skipped because authentication is on.");
             }
             return;
         case AuthenticationRequirement.On:
             if (CoreTestConfiguration.ConnectionString.Username == null)
             {
                 throw new SkipTestException("Test skipped because authentication is off.");
             }
             return;
         case AuthenticationRequirement.Unspecified:
             return;
         default:
             throw new ArgumentException($"Invalid authentication requirement: {authentication}.", nameof(authentication));
     }
 }
Exemple #5
0
 public MyAuthAttribute(AuthenticationRequirement requirement)
 {
     _requirement = requirement;
 }