/// <summary>
 /// Downloads a package to local folder and see if the download is successful. Used to individual tests which extend the download scenarios.
 /// </summary>
 /// <param name="packageId"></param>
 public static void DownloadPackageAndVerify(string packageId, string version = "1.0.0")
 {
     ClientSDKHelper.ClearMachineCache();
     ClientSDKHelper.ClearLocalPackageFolder(packageId);
     new PackageManager(PackageRepositoryFactory.Default.CreateRepository(UrlHelper.V2FeedRootUrl), Environment.CurrentDirectory).InstallPackage(packageId, new SemanticVersion(version));
     Assert.IsTrue(ClientSDKHelper.CheckIfPackageVersionInstalled(packageId, version), "Package install failed. Either the file is not present on disk or it is corrupted. Check logs for details");
 }
        public void DownPackageWithNuGetCommandLineTest()
        {
            string packageId = Constants.TestPackageId; //try to down load a pre-defined test package.

            ClientSDKHelper.ClearLocalPackageFolder(packageId);
            int exitCode = CmdLineHelper.InstallPackage(packageId, UrlHelper.V2FeedRootUrl);

            Assert.IsTrue((exitCode == 0), "The package install via Nuget.exe didnt suceed properly. Check the logs to see the process error and output stream");
            Assert.IsTrue(ClientSDKHelper.CheckIfPackageInstalled(packageId), "Package install failed. Either the file is not present on disk or it is corrupted. Check logs for details");
        }
        public void DownloadPackageWithNuGetCommandLineTest()
        {
            string packageId = Constants.TestPackageId; //try to down load a pre-defined test package.

            ClientSDKHelper.ClearLocalPackageFolder(packageId);
            int exitCode = CmdLineHelper.InstallPackage(packageId, UrlHelper.V2FeedRootUrl, Environment.CurrentDirectory);

            Assert.IsTrue((exitCode == 0), Constants.PackageDownloadFailureMessage);
            Assert.IsTrue(ClientSDKHelper.CheckIfPackageInstalled(packageId), Constants.PackageInstallFailureMessage);
        }
 public void DownloadPackageWithNuGetCommandLineTest()
 {
     // Temporary work around for the SSL issue, which keeps the upload tests from working on sites with cloudapp.net
     if (UrlHelper.BaseUrl.Contains("nugettest.org") || UrlHelper.BaseUrl.Contains("nuget.org"))
     {
         string packageId = Constants.TestPackageId; //try to down load a pre-defined test package.
         ClientSDKHelper.ClearLocalPackageFolder(packageId);
         int exitCode = CmdLineHelper.InstallPackage(packageId, UrlHelper.V2FeedRootUrl, Environment.CurrentDirectory);
         Assert.IsTrue((exitCode == 0), Constants.PackageDownloadFailureMessage);
         Assert.IsTrue(ClientSDKHelper.CheckIfPackageInstalled(packageId), Constants.PackageInstallFailureMessage);
     }
 }