tests/NuGetGallery.FunctionalTests.Core/Helpers/ClientSdkHelper.cs
/// <summary>
/// Gets an API key with the same owner as <paramref name="apiKey"/>.
/// </summary>
/// <remarks>
/// This function is used to create a package that <paramref name="apiKey"/> can be used on if no existing package can be used.
/// In other words, if a test requires unlisting a package with an API key, but there is no existing package that can be unlisted by that API key, this function is used to find an API key that can be used to upload a package for that API key to then unlist.
/// </remarks>
Gets an API key with the same owner as .
Gets an API key with the same owner as .
private static string GetApiKeyWithSameOwnerThatCanUpload(string apiKey = null)
        {
            if (apiKey == null ||
                apiKey == GalleryConfiguration.Instance.Account.ApiKey ||
                apiKey == GalleryConfiguration.Instance.Account.ApiKeyPush ||
                apiKey == GalleryConfiguration.Instance.Account.ApiKeyPushVersion ||
                apiKey == GalleryConfiguration.Instance.Account.ApiKeyUnlist)
            {
                return GalleryConfiguration.Instance.Account.ApiKey;
            }
            else if (apiKey == GalleryConfiguration.Instance.AdminOrganization.ApiKey)
            {
                return GalleryConfiguration.Instance.AdminOrganization.ApiKey;
            }
            else if (apiKey == GalleryConfiguration.Instance.CollaboratorOrganization.ApiKey)
            {
                return GalleryConfiguration.Instance.CollaboratorOrganization.ApiKey;
            }
            throw new ArgumentOutOfRangeException(nameof(apiKey));
        }
private static string GetApiKeyWithSameOwnerThatCanUpload ( string apiKey = null ) { if ( apiKey == null || apiKey == GalleryConfiguration . Instance . Account . ApiKey || apiKey == GalleryConfiguration . Instance . Account . ApiKeyPush || apiKey == GalleryConfiguration . Instance . Account . ApiKeyPushVersion || apiKey == GalleryConfiguration . Instance . Account . ApiKeyUnlist ) { return GalleryConfiguration . Instance . Account . ApiKey ; } else if ( apiKey == GalleryConfiguration . Instance . AdminOrganization . ApiKey ) { return GalleryConfiguration . Instance . AdminOrganization . ApiKey ; } else if ( apiKey == GalleryConfiguration . Instance . CollaboratorOrganization . ApiKey ) { return GalleryConfiguration . Instance . CollaboratorOrganization . ApiKey ; } throw new ArgumentOutOfRangeException ( nameof ( apiKey ) ) ; }
Gets an API key with the same owner as .
Gets an API key with the same owner as .
apiKey
string
remarks
This function is used to create a package that  can be used on if no existing package can be used.
In other words, if a test requires unlisting a package with an API key, but there is no existing package that can be unlisted by that API key, this function is used to find an API key that can be used to upload a package for that API key to then unlist.
This function is used to create a package that can be used on if no existing package can be used . In other words if a test requires unlisting a package with an API key but there is no existing package that can be unlisted by that API key this function is used to find an API key that can be used to upload a package for that API key to then unlist .