Example #1
0
 public void AddPackagesTest()
 {
     CreateProject();
     NuGetController.AddPackage(new NuGetPackageOptions {
         PackageName  = "CommandLineParser",
         Version      = "2.0.257-beta",
         IsPreRelease = true
     }, this);
 }
Example #2
0
 public void TestDontShowWarningWithPowerShellScripts()
 {
     CreateProject();
     NuGetController.AddPackage(new NuGetPackageOptions {
         PackageName = "Newtonsoft.Json",
     }, this);
     WaitForNuGet.Success("Newtonsoft.Json", NuGetOperations.Add, false, this);
     TakeScreenShot("NewtonSoftJson-Package-Added-Without-Warning");
 }
Example #3
0
 public void TestReadmeTxtOpens()
 {
     CreateProject();
     NuGetController.AddPackage(new NuGetPackageOptions {
         PackageName  = "RestSharp",
         Version      = "105.2.3",
         IsPreRelease = true
     }, this);
     WaitForNuGetReadmeOpened();
 }
Example #4
0
 public void TestReadmeTxtOpens()
 {
     CreateProject();
     NuGetController.AddPackage(new NuGetPackageOptions {
         PackageName  = "RestSharp",
         Version      = "105.0.1",
         IsPreRelease = true
     });
     Session.WaitForElement(c => c.Window().Marked("MonoDevelop.Ide.Gui.DefaultWorkbench").Property("TabControl.CurrentTab.Text", "readme.txt"));
 }
Example #5
0
 public void TestReadmeTxtUpgradeOpens()
 {
     CreateProject();
     NuGetController.AddPackage(new NuGetPackageOptions {
         PackageName  = "RestSharp",
         Version      = "105.0.1",
         IsPreRelease = true
     }, TakeScreenShot);
     Session.WaitForElement(c => c.Window().Marked("MonoDevelop.Ide.Gui.DefaultWorkbench").Property("TabControl.CurrentTab.Text", "readme.txt"));
     Session.ExecuteCommand(FileCommands.CloseFile);
     Session.WaitForElement(IdeQuery.TextArea);
     NuGetController.UpdatePackage(new NuGetPackageOptions {
         PackageName  = "RestSharp",
         Version      = "105.1.0",
         IsPreRelease = true
     }, TakeScreenShot);
     Session.WaitForElement(c => c.Window().Marked("MonoDevelop.Ide.Gui.DefaultWorkbench").Property("TabControl.CurrentTab.Text", "readme.txt"));
 }
Example #6
0
        public void TestReadmeTxtUpgradeOpens()
        {
            CreateProject();
            NuGetController.AddPackage(new NuGetPackageOptions {
                PackageName  = "RestSharp",
                Version      = "105.2.2",
                IsPreRelease = true
            }, this);
            WaitForNuGetReadmeOpened();

            Session.ExecuteCommand(FileCommands.CloseFile);
            Session.WaitForElement(IdeQuery.TextArea);
            TakeScreenShot("About-To-Update-Package");
            NuGetController.UpdatePackage(new NuGetPackageOptions {
                PackageName  = "RestSharp",
                Version      = "105.2.3",
                IsPreRelease = true
            }, this);
            WaitForNuGetReadmeOpened();
        }
Example #7
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");
        }
Example #8
0
        public void TestDontOpenReadmeOpenedInOther()
        {
            var packageInfo = new NuGetPackageOptions {
                PackageName  = "RestSharp",
                Version      = "105.2.3",
                IsPreRelease = true
            };

            var projectDetails = CreateProject();

            NuGetController.AddPackage(packageInfo, this);
            WaitForNuGetReadmeOpened();
            Session.ExecuteCommand(FileCommands.CloseFile);

            var pclTemplateOptions = new TemplateSelectionOptions {
                CategoryRoot     = "Other",
                Category         = ".NET",
                TemplateKindRoot = "General",
                TemplateKind     = "Library"
            };
            var pclProjectDetails = ProjectDetails.ToExistingSolution(projectDetails.SolutionName,
                                                                      GenerateProjectName(pclTemplateOptions.TemplateKind));

            CreateProject(pclTemplateOptions, pclProjectDetails);
            Ide.WaitForIdeIdle(30);

            SolutionExplorerController.SelectProject(projectDetails.SolutionName, pclProjectDetails.ProjectName);
            NuGetController.AddPackage(packageInfo, this);
            try {
                WaitForNuGetReadmeOpened(false);
                var failureMessage = string.Format("Expected: {0}\nActual:{1}",
                                                   "readme.txt tab should not open", "readme.txt tab opens");
                ReproStep(failureMessage);
                Assert.Fail(failureMessage);
            } catch (TimeoutException) {
                Session.DebugObject.Debug("readme.txt tab failed to open as expected");
            }
        }
Example #9
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);
        }
Example #10
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.71",
                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));

            ReproStep("Check 'Local Copy' on CommandLine package under References");

            Workbench.CloseWorkspace(this);

            AddOrCheckLocalCopy(projectPath, true);

            Workbench.OpenWorkspace(solutionPath, this);

            NuGetController.UpdateAllNuGetPackages(this);

            ReproStep("Check if CommandLine package under References has 'Local Copy' checked");
            AddOrCheckLocalCopy(projectPath, false);
        }