コード例 #1
0
        public async Task DownloadPackage()
        {
            string packageId = Constants.TestPackageId; //try to download a pre-defined test package.

            _clientSdkHelper.ClearLocalPackageFolder(packageId, ClientSdkHelper.GetLatestStableVersion(packageId));

            var result = await _commandlineHelper.InstallPackageAsync(packageId, UrlHelper.V2FeedRootUrl, Environment.CurrentDirectory);

            Assert.True(result.ExitCode == 0, Constants.PackageDownloadFailureMessage);
            Assert.True(_clientSdkHelper.CheckIfPackageInstalled(packageId), Constants.PackageInstallFailureMessage);
        }
        public async Task 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);

                var result = await _commandlineHelper.InstallPackageAsync(packageId, UrlHelper.V2FeedRootUrl, Environment.CurrentDirectory);

                Assert.True(result.ExitCode == 0, Constants.PackageDownloadFailureMessage);
                Assert.True(_clientSdkHelper.CheckIfPackageInstalled(packageId), Constants.PackageInstallFailureMessage);
            }
        }