C# Class NuGetGallery.FunctionalTests.ClientSdkHelper

Inheritance: NuGetGallery.FunctionalTests.HelperBase
Exibir arquivo Open project: NuGet/NuGetGallery Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
CheckIfPackageExistsInSource ( string packageId, string sourceUrl ) : bool

Checks if the given package is present in the source.

CheckIfPackageInstalled ( string packageId ) : bool

Given a package checks if it is installed properly in the current dir.

CheckIfPackageVersionExistsInSource ( string packageId, string version, string sourceUrl ) : bool

Checks if the given package version is present in the source.

CheckIfPackageVersionInstalled ( string packageId, string packageVersion ) : bool

Given a package checks if it that version of the package is installed.

ClearLocalPackageFolder ( string packageId, string version = "1.0.0" ) : void

Clears the local package folder.

ClearMachineCache ( ) : void

Clears the local machine cache.

ClientSdkHelper ( ITestOutputHelper testOutputHelper ) : System
DownloadPackageAndVerify ( string packageId, string version = "1.0.0" ) : void

Downloads a package to local folder and see if the download is successful. Used to individual tests which extend the download scenarios.

GetDownLoadStatistics ( string packageId ) : int

Returns the download count of the given package.

GetDownLoadStatisticsForPackageVersion ( string packageId, string packageVersion ) : int

Returns the download count of the specific version of the package.

GetFormattedDownLoadStatistics ( string packageId ) : string

Returns the download count of the given package as a formatted string as it would appear in the gallery UI.

GetLatestStableVersion ( string packageId ) : string

Returns the latest stable version string for the given package.

GetPackageCountForSearchTerm ( string searchQuery ) : int

Searchs the gallery to get the packages matching the specific search term and returns their count.

GetPackageIdFromNupkgFile ( string filePath ) : string

Given the path to the nupkg file, returns the corresponding package ID.

GetVersionCount ( string packageId, bool allowPreRelease = true ) : int

Returns the count of versions available for the given package

IsPackageVersionUnListed ( string packageId, string version ) : bool

Given the path to the nupkg file, returns the corresponding package ID.

UnlistPackage ( string packageId, string version = "1.0.0" ) : Task
UnlistPackageAndVerify ( string packageId, string version = "1.0.0" ) : Task

Unlists a package with the specified Id and Version and checks if the unlist has succeeded. Throws if the unlist fails or cannot be verified in the source.

UploadNewPackage ( string packageId, string version = "1.0.0", string minClientVersion = null, string title = null, string tags = null, string description = null, string licenseUrl = null, string dependencies = null ) : Task
UploadNewPackageAndVerify ( string packageId, string version = "1.0.0", string minClientVersion = null, string title = null, string tags = null, string description = null, string licenseUrl = null, string dependencies = null ) : Task

Creates a package with the specified Id and Version and uploads it and checks if the upload has succeeded. Throws if the upload fails or cannot be verified in the source.

VerifyPackageExistsInSource ( string packageId, string version = "1.0.0" ) : void

Throws if the specified package cannot be found in the source.

Method Details

CheckIfPackageExistsInSource() public method

Checks if the given package is present in the source.
public CheckIfPackageExistsInSource ( string packageId, string sourceUrl ) : bool
packageId string
sourceUrl string
return bool

CheckIfPackageInstalled() public method

Given a package checks if it is installed properly in the current dir.
public CheckIfPackageInstalled ( string packageId ) : bool
packageId string
return bool

CheckIfPackageVersionExistsInSource() public method

Checks if the given package version is present in the source.
public CheckIfPackageVersionExistsInSource ( string packageId, string version, string sourceUrl ) : bool
packageId string
version string
sourceUrl string
return bool

CheckIfPackageVersionInstalled() public method

Given a package checks if it that version of the package is installed.
public CheckIfPackageVersionInstalled ( string packageId, string packageVersion ) : bool
packageId string
packageVersion string
return bool

ClearLocalPackageFolder() public method

Clears the local package folder.
public ClearLocalPackageFolder ( string packageId, string version = "1.0.0" ) : void
packageId string
version string
return void

ClearMachineCache() public static method

Clears the local machine cache.
public static ClearMachineCache ( ) : void
return void

ClientSdkHelper() public method

public ClientSdkHelper ( ITestOutputHelper testOutputHelper ) : System
testOutputHelper ITestOutputHelper
return System

DownloadPackageAndVerify() public method

Downloads a package to local folder and see if the download is successful. Used to individual tests which extend the download scenarios.
public DownloadPackageAndVerify ( string packageId, string version = "1.0.0" ) : void
packageId string
version string
return void

GetDownLoadStatistics() public static method

Returns the download count of the given package.
public static GetDownLoadStatistics ( string packageId ) : int
packageId string
return int

GetDownLoadStatisticsForPackageVersion() public static method

Returns the download count of the specific version of the package.
public static GetDownLoadStatisticsForPackageVersion ( string packageId, string packageVersion ) : int
packageId string
packageVersion string
return int

GetFormattedDownLoadStatistics() public static method

Returns the download count of the given package as a formatted string as it would appear in the gallery UI.
public static GetFormattedDownLoadStatistics ( string packageId ) : string
packageId string
return string

GetLatestStableVersion() public static method

Returns the latest stable version string for the given package.
public static GetLatestStableVersion ( string packageId ) : string
packageId string
return string

GetPackageCountForSearchTerm() public static method

Searchs the gallery to get the packages matching the specific search term and returns their count.
public static GetPackageCountForSearchTerm ( string searchQuery ) : int
searchQuery string
return int

GetPackageIdFromNupkgFile() public method

Given the path to the nupkg file, returns the corresponding package ID.
public GetPackageIdFromNupkgFile ( string filePath ) : string
filePath string
return string

GetVersionCount() public method

Returns the count of versions available for the given package
public GetVersionCount ( string packageId, bool allowPreRelease = true ) : int
packageId string
allowPreRelease bool
return int

IsPackageVersionUnListed() public method

Given the path to the nupkg file, returns the corresponding package ID.
public IsPackageVersionUnListed ( string packageId, string version ) : bool
packageId string
version string
return bool

UnlistPackage() public method

public UnlistPackage ( string packageId, string version = "1.0.0" ) : Task
packageId string
version string
return Task

UnlistPackageAndVerify() public method

Unlists a package with the specified Id and Version and checks if the unlist has succeeded. Throws if the unlist fails or cannot be verified in the source.
public UnlistPackageAndVerify ( string packageId, string version = "1.0.0" ) : Task
packageId string
version string
return Task

UploadNewPackage() public method

public UploadNewPackage ( string packageId, string version = "1.0.0", string minClientVersion = null, string title = null, string tags = null, string description = null, string licenseUrl = null, string dependencies = null ) : Task
packageId string
version string
minClientVersion string
title string
tags string
description string
licenseUrl string
dependencies string
return Task

UploadNewPackageAndVerify() public method

Creates a package with the specified Id and Version and uploads it and checks if the upload has succeeded. Throws if the upload fails or cannot be verified in the source.
public UploadNewPackageAndVerify ( string packageId, string version = "1.0.0", string minClientVersion = null, string title = null, string tags = null, string description = null, string licenseUrl = null, string dependencies = null ) : Task
packageId string
version string
minClientVersion string
title string
tags string
description string
licenseUrl string
dependencies string
return Task

VerifyPackageExistsInSource() public method

Throws if the specified package cannot be found in the source.
public VerifyPackageExistsInSource ( string packageId, string version = "1.0.0" ) : void
packageId string Id of the package.
version string Version of the package.
return void