Example #1
0
        public void DebugProjectProperties()
        {
            using (var app = new PythonVisualStudioApp()) {
                var project = app.CreateProject(
                    PythonVisualStudioApp.TemplateLanguageName,
                    PythonVisualStudioApp.DjangoWebProjectTemplate,
                    TestData.GetTempPath(),
                    "DebugProjectProperties"
                    );
                app.SolutionExplorerTreeView.SelectProject(project);

                app.Dte.ExecuteCommand("ClassViewContextMenus.ClassViewMultiselectProjectreferencesItems.Properties");
                var window = app.Dte.Windows.OfType <EnvDTE.Window>().FirstOrDefault(w => w.Caption == project.Name);
                Assert.IsNotNull(window);

                window.Activate();
                var hwnd      = window.HWnd;
                var projProps = new ProjectPropertiesWindow(new IntPtr(hwnd));

                var debugPage = projProps[new Guid(PythonConstants.DebugPropertyPageGuid)];
                Assert.IsNotNull(debugPage);

                var dbgProps = new PythonProjectDebugProperties(debugPage);
                Assert.AreEqual("Django Web launcher", dbgProps.LaunchMode);
                dbgProps.AssertMatchesProject(project.GetPythonProject());
            }
        }
Example #2
0
        public void DebugProjectProperties(VisualStudioApp app, DjangoInterpreterSetter interpreterSetter)
        {
            var project = app.CreateProject(
                PythonVisualStudioApp.TemplateLanguageName,
                PythonVisualStudioApp.DjangoWebProjectTemplate,
                TestData.GetTempPath(),
                "DebugProjectProperties"
                );

            app.SolutionExplorerTreeView.SelectProject(project);

            app.Dte.ExecuteCommand("Project.Properties");
            var window = app.Dte.Windows.OfType <EnvDTE.Window>().FirstOrDefault(w => w.Caption == project.Name);

            Assert.IsNotNull(window);

            window.Activate();
            var hwnd      = window.HWnd;
            var projProps = new ProjectPropertiesWindow(new IntPtr(hwnd));

            // FYI This is broken on Dev15 (15.0 up to latest build as of now 15.3 build 26507)
            // Active page can't be changed via UI automation.
            // Bug 433488 has been filed.
            // - InvokePattern is not available
            // - SelectionItemPattern is available (according to Inspect) but does not work
            // - Default action does nothing
            var debugPage = projProps[new Guid(PythonConstants.DebugPropertyPageGuid)];

            Assert.IsNotNull(debugPage);

            var dbgProps = new PythonProjectDebugProperties(debugPage);

            Assert.AreEqual("Django Web launcher", dbgProps.LaunchMode);
            dbgProps.AssertMatchesProject(project.GetPythonProject());
        }