public CQStoredCredentialManager( ICredentialManagementService credManagementService, MigrationSource migrationSourceConfig) { var credentials = credManagementService.GetCredentialsForMigrationSource(new Guid(migrationSourceConfig.InternalUniqueId)); if (null == credentials || credentials.Count == 0) { string credUri = (migrationSourceConfig.StoredCredential == null ? string.Empty : migrationSourceConfig.StoredCredential.CredentialString); throw new InvalidOperationException( string.Format(ClearQuestResource.ClearQuest_Error_CredntialMissing, credUri)); } else { Debug.Assert(credentials.Count == 1, "more than 1 credentials are found"); UserName = credentials[0].UserName; Password = credentials[0].Password; } }