Ejemplo n.º 1
0
        public void DontShowPackageUpdatesAvailable()
        {
            var templateOptions = new TemplateSelectionOptions {
                CategoryRoot     = OtherCategoryRoot,
                Category         = ".NET",
                TemplateKindRoot = GeneralKindRoot,
                TemplateKind     = "Console Project"
            };
            var projectDetails = new ProjectDetails(templateOptions);

            CreateProject(templateOptions, projectDetails);
            NuGetController.AddPackage(new NuGetPackageOptions {
                PackageName  = "CommandLineParser",
                Version      = "1.9.3.34",
                IsPreRelease = false
            }, this);

            string solutionFolder = GetSolutionDirectory();
            string solutionPath   = Path.Combine(solutionFolder, projectDetails.SolutionName + ".sln");
            var    projectPath    = Path.Combine(solutionFolder, projectDetails.ProjectName, projectDetails.ProjectName + ".csproj");

            Assert.IsTrue(File.Exists(projectPath));

            Workbench.CloseWorkspace(this);

            Workbench.OpenWorkspace(solutionPath, this);
            try {
                const string expected = "When a solution is opened and package updates are available, it don't show in status bar";
                ReproStep(expected);
                Ide.WaitForPackageUpdate();
                var failureMessage = string.Format("Expected: {0}\nActual: {1}",
                                                   expected, "When a solution is opened and package updates are available, it shows in status bar");
                ReproStep(failureMessage);
                Assert.Fail(failureMessage);
            } catch (TimeoutException) {
                Session.DebugObject.Debug("WaitForPackageUpdate throws TimeoutException as expected");
            }
            Ide.WaitForSolutionLoaded();
            TakeScreenShot("Solution-Ready");
        }