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
Exemplo n.º 1
0
        public async Task CheckIfBaseTestPackageExistsAsync()
        {
            // Check if the BaseTestPackage exists in current source and if not upload it.
            // This will be used by the download related tests.
            try
            {
                var clientSdkHelper = new ClientSdkHelper(ConsoleTestOutputHelper.New);
                if (!clientSdkHelper.CheckIfPackageExistsInSource(Constants.TestPackageId, UrlHelper.V2FeedRootUrl))
                {
                    var testOutputHelper      = ConsoleTestOutputHelper.New;
                    var commandlineHelper     = new CommandlineHelper(testOutputHelper);
                    var packageCreationHelper = new PackageCreationHelper(testOutputHelper);
                    var packageFullPath       = await packageCreationHelper.CreatePackage(Constants.TestPackageId, "1.0.0");

                    var processResult = await commandlineHelper.UploadPackageAsync(packageFullPath, UrlHelper.V2FeedPushSourceUrl);

                    Assert.True(processResult.ExitCode == 0, Constants.UploadFailureMessage);
                }
            }
            catch (Exception exception)
            {
                var message = string.Format(
                    "The initialization method to pre-upload test package has failed. Hence failing all the tests. Make sure that a package by name {0} exists @ {1} before running tests. Check test run error for details",
                    Constants.TestPackageId, UrlHelper.BaseUrl);
                throw new InvalidOperationException(message, exception);
            }
        }
 public async Task CheckIfBaseTestPackageExistsAsync()
 {
     // Check if the BaseTestPackage exists in current source and if not upload it.
     // This will be used by the download related tests.
     try
     {
         var clientSdkHelper = new ClientSdkHelper(ConsoleTestOutputHelper.New);
         if (!clientSdkHelper.CheckIfPackageExistsInSource(Constants.TestPackageId, UrlHelper.V2FeedRootUrl))
         {
             await clientSdkHelper.UploadNewPackageAndVerify(Constants.TestPackageId);
         }
     }
     catch (Exception exception)
     {
         var message = string.Format(
             "The initialization method to pre-upload test package has failed. Hence failing all the tests. Make sure that a package by name {0} exists @ {1} before running tests. Check test run error for details",
             Constants.TestPackageId, UrlHelper.BaseUrl);
         throw new InvalidOperationException(message, exception);
     }
 }
Exemplo n.º 3
0
 public async Task CheckIfBaseTestPackageExistsAsync()
 {
     // Check if the BaseTestPackage exists in current source and if not upload it.
     // This will be used by the download related tests.
     try
     {
         var clientSdkHelper = new ClientSdkHelper(ConsoleTestOutputHelper.New);
         if (!clientSdkHelper.CheckIfPackageExistsInSource(Constants.TestPackageId, UrlHelper.V2FeedRootUrl))
         {
             await clientSdkHelper.UploadNewPackageAndVerify(Constants.TestPackageId);
         }
     }
     catch (Exception exception)
     {
         var message = string.Format(
                 "The initialization method to pre-upload test package has failed. Hence failing all the tests. Make sure that a package by name {0} exists @ {1} before running tests. Check test run error for details",
                 Constants.TestPackageId, UrlHelper.BaseUrl);
         throw new InvalidOperationException(message, exception);
     }
 }