コード例 #1
0
        [Ignore] //This method is marked ignore as we don't it to be run in regular runs. It will be run only when required.
        public void UploadAndDownLoadTestBombPackage()
        {
            string packageId       = DateTime.Now.Ticks.ToString() + testContextInstance.TestName;
            string version         = "1.0.0";
            string packageFullPath = PackageCreationHelper.CreateGalleryTestBombPackage(packageId);
            int    exitCode        = CmdLineHelper.UploadPackage(packageFullPath, UrlHelper.V2FeedPushSourceUrl);

            Assert.IsTrue((exitCode == 0), "The package upload via Nuget.exe didnt suceed properly. Check the logs to see the process error and output stream");
            Assert.IsTrue(ClientSDKHelper.CheckIfPackageVersionExistsInSource(packageId, version, UrlHelper.V2FeedRootUrl), "Package {0} is not found in the site {1} after uploading.", packageId, UrlHelper.V2FeedRootUrl);

            //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);
            }

            AssertAndValidationHelper.DownloadPackageAndVerify(packageId);
        }