public async Task UploadAndDownLoadPackageWithMinClientVersion()
        {
            if (UrlHelper.BaseUrl.Contains("nugettest.org") || UrlHelper.BaseUrl.Contains("nuget.org"))
            {
                string packageId       = DateTime.Now.Ticks + "PackageWithDotCsNames.Cs";
                string version         = "1.0.0";
                string packageFullPath = await _packageCreationHelper.CreatePackageWithMinClientVersion(packageId, version, "2.3");

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

                Assert.True(processResult.ExitCode == 0, Constants.UploadFailureMessage);

                var packageVersionExistsInSource = _clientSdkHelper.CheckIfPackageVersionExistsInSource(packageId, version, UrlHelper.V2FeedRootUrl);
                var userMessage = string.Format(Constants.PackageNotFoundAfterUpload, packageId, UrlHelper.V2FeedRootUrl);
                Assert.True(packageVersionExistsInSource, userMessage);

                //Delete package from local disk so once it gets uploaded
                if (File.Exists(packageFullPath))
                {
                    File.Delete(packageFullPath);
                    Directory.Delete(Path.GetFullPath(Path.GetDirectoryName(packageFullPath)), true);
                }
                _clientSdkHelper.DownloadPackageAndVerify(packageId);
            }
        }
コード例 #2
0
        public async Task UploadAndDownloadPackageWithMinClientVersion()
        {
            string packageId       = $"{Guid.NewGuid():N}PackageWithDotCsNames.Cs";
            string version         = "1.0.0";
            string packageFullPath = await _packageCreationHelper.CreatePackageWithMinClientVersion(packageId, version, "2.3");

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

            Assert.True(processResult.ExitCode == 0, Constants.UploadFailureMessage);

            await _clientSdkHelper.VerifyPackageExistsInV2AndV3Async(packageId, version);

            //Delete package from local disk so once it gets uploaded
            if (File.Exists(packageFullPath))
            {
                File.Delete(packageFullPath);
                Directory.Delete(Path.GetFullPath(Path.GetDirectoryName(packageFullPath)), true);
            }
            _clientSdkHelper.DownloadPackageAndVerify(packageId, version);
        }
コード例 #3
0
 public void DownloadPackageWithNuGetCoreTest()
 {
     //try to down load a pre-defined test package - BaseTestPackage.
     _clientSdkHelper.DownloadPackageAndVerify(Constants.TestPackageId);
 }