예제 #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");
        }
예제 #2
0
        public void TestLocalCopyPreservedUpdate()
        {
            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.7",
                IsPreRelease = false
            }, TakeScreenShot);

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

            TakeScreenShot("About-To-Close-Solution");
            Session.ExecuteCommand(FileCommands.CloseWorkspace);
            TakeScreenShot("Closed-Solution");

            AddOrCheckLocalCopy(projectPath, true);

            Session.GlobalInvoke("MonoDevelop.Ide.IdeApp.Workspace.OpenWorkspaceItem", new FilePath(solutionPath), true);
            TakeScreenShot("Solution-Opened");
            Ide.WaitForPackageUpdate();
            TakeScreenShot("Solution-Ready");

            NuGetController.UpdateAllNuGetPackages(TakeScreenShot);

            AddOrCheckLocalCopy(projectPath, false);
        }