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)); } }
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); } }
public MyAuthAttribute(AuthenticationRequirement requirement) { _requirement = requirement; }