コード例 #1
0
        public void CleaningFileTypesXML_DisablesForDocumentWhenSettingIsDisabled()
        {
            Settings.Default.Cleaning_IncludeXML = false;

            UIThreadInvoker.Invoke(new Action(() =>
            {
                // Make sure the document is the active document for the environment.
                var document = TestOperations.GetActivatedDocument(_projectItem);
                Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument);

                // Confirm the code cleanup availability logic is in the expected state.
                Assert.IsFalse(_codeCleanupAvailabilityLogic.CanCleanupDocument(document));
            }));
        }
コード例 #2
0
        public void CleaningFileTypesCPlusPlus_EnablesForDocument()
        {
            Settings.Default.Cleaning_IncludeCPlusPlus = true;

            UIThreadInvoker.Invoke(new Action(() =>
            {
                // Make sure the document is the active document for the environment.
                var document = TestOperations.GetActivatedDocument(_projectItem);
                Assert.AreEqual(document, TestEnvironment.Package.ActiveDocument);

                // Confirm the code cleanup availability logic is in the expected state.
                Assert.IsTrue(_codeCleanupAvailabilityLogic.ShouldCleanup(document));
            }));
        }
コード例 #3
0
        public void PackageLoadTest()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate() {
                //Get the Shell Service
                IVsShell shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;
                Assert.IsNotNull(shellService);

                //Validate package load
                IVsPackage package;
                Guid packageGuid = new Guid(Company.VisualStudioHaskell.GuidList.guidVisualStudioHaskellPkgString);
                Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package));
                Assert.IsNotNull(package, "Package failed to load");
            });
        }
コード例 #4
0
        public void BetweenDiffFolders1()
        {
            //"Program3.fs"
            //"Folder1\\File3.fs"
            //"Folder1\\File4.fs"
            //"Folder1\\Sub1\File2.fs"
            //"Folder1\\Sub1\\SubSub1\\File1.fs"
            //"Folder1\\Sub2\\File1.fs"
            //"Folder1\\File1.fs"
            //"Folder2\\File1.fs"
            //"Program.fs"
            //"Program2.fs"
            //"Folder3\\CompileFile1.fs",
            //"Folder3\\ContentFile1.fs",
            //"Folder3\\NoneFile1.fs"


            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                new SwapConfig("BetweenDiffFolders", ref testContext)
                .Move(
                    new MoveOp {
                    Index = 3, Dir = CompileOrderViewer.Direction.Up
                },
                    new MoveOp {
                    Index = 2, Dir = CompileOrderViewer.Direction.Up
                },
                    new MoveOp {
                    Index = 1, Dir = CompileOrderViewer.Direction.Up
                }
                    )
                .ExpectedOrder(
                    "Folder1\\Sub1\\File2.fs",
                    "Program3.fs",
                    "Folder1\\File3.fs",
                    "Folder1\\File4.fs",
                    "Folder1\\Sub1\\SubSub1\\File1.fs",
                    "Folder1\\Sub2\\File1.fs",
                    "Folder1\\File1.fs",
                    "Folder2\\File1.fs",
                    "Program.fs",
                    "Program2.fs",
                    "Folder3\\CompileFile1.fs"                        //,
                    //"Folder3\\ContentFile1.fs",
                    //"Folder3\\NoneFile1.fs"
                    )
                .Run();
            });
        }
コード例 #5
0
        public void PackageLoadTest()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the Shell Service
                IVsShell shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;
                Assert.IsNotNull(shellService);

                //Validate package load
                IVsPackage package;
                Guid packageGuid = new Guid(Predelnik.RemoveTrailingWhitespaces.GuidList.guidRemoveTrailingWhitespacesPkgString);
                Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package));
                Assert.IsNotNull(package, "Package failed to load");
            });
        }
コード例 #6
0
        public void PackageLoadTest()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the Shell Service
                IVsShell shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;
                Assert.IsNotNull(shellService);

                //Validate package load
                IVsPackage package;
                Guid packageGuid = new Guid(SmallSharpTools.JavaScriptBrowser.VSPackage.GuidList.guidJavaScriptBrowserPkgString);
                Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package));
                Assert.IsNotNull(package, "Package failed to load");
            });
        }
コード例 #7
0
 public void CreateRustLibraryProject()
 {
     UIThreadInvoker.Invoke((Action) delegate()
     {
         string projName = Utils.GetCallingFunction();
         Utils.CreateEmptySolution(TestContext.TestDir, projName);
         Utils.CreateProjectFromTemplate(projName, "Rust Library", "Rust", false);
         ProjectNode root = Utils.GetProject(projName);
         Assert.IsNotNull(root);
         new HierarchyCheck(root)
         .Child <FolderNode>("src")
         .Child <FileNode>("lib.rs")
         .Run();
     });
 }
コード例 #8
0
ファイル: PackageTest.cs プロジェクト: papergirl/VSTest
        public void PackageLoadTest()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the Shell Service
                IVsShell shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;
                Assert.IsNotNull(shellService);

                //Validate package load
                IVsPackage package;
                Guid packageGuid = new Guid(KittyAltruistic.CPlusPlusTestRunner.GuidList.GUIDTestPackagePkgString);
                Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package));
                Assert.IsNotNull(package, "Package failed to load");
            });
        }
コード例 #9
0
        public void WinformsApplication()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                TestUtils.CreateEmptySolution(TestContext.TestDir, "CSWinApp");
                Assert.AreEqual <int>(0, TestUtils.ProjectCount());

                //Create Winforms application project
                //TestUtils.CreateProjectFromTemplate("MyWindowsApp", "Windows Application", "CSharp", false);
                //Assert.AreEqual<int>(1, TestUtils.ProjectCount());
                //TODO Verify that we can debug launch the application
                //TODO Set Break point and verify that will hit
                //TODO Verify Adding new project item to project
            });
        }
コード例 #10
0
ファイル: TestProject.cs プロジェクト: yangfan79/MPFProj10
        public void TestHasProjectOpened()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the global service provider and the dte
                IServiceProvider sp = VsIdeTestHostContext.ServiceProvider;
                DTE dte             = (DTE)sp.GetService(typeof(DTE));

                string destination  = Path.Combine(TestContext.TestDir, TestContext.TestName);
                ProjectNode project = Utilities.CreateMyNestedProject(sp, dte, TestContext.TestName, destination, true);

                bool hasProjectOpened = project.HasProjectOpened;
                Assert.IsTrue(hasProjectOpened, "The event listener for opening the project has failed");
            });
        }
コード例 #11
0
ファイル: PackageTest.cs プロジェクト: wushian/LINQBridgeVs
        public void PackageLoadTest()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the Shell Service
                var shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;
                Assert.IsNotNull(shellService);

                //Validate package load
                IVsPackage package;
                var packageGuid = new Guid(LINQBridgeVs.Extension.GuidList.GuidBridgeVsExtensionPkgString);
                Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package));
                Assert.IsNotNull(package, "Package failed to load");
            });
        }
コード例 #12
0
        public void PackageLoadTest()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the Shell Service
                IVsShell shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;
                Assert.IsNotNull(shellService);

                //Validate package load
                IVsPackage package;
                Guid packageGuid = new Guid(MicrosoftCorporation.SlowCheetah.GuidList.guidSlowCheetahPkgString);
                Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package));
                Assert.IsNotNull(package, "Package failed to load");
            });
        }
コード例 #13
0
        public void PackageLoadTest()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the Shell Service
                IVsShell shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;
                Assert.IsNotNull(shellService);

                //Validate package load
                IVsPackage package;
                Guid packageGuid = new Guid(McKearney.TfsSolutionInfo.GuidList.guidTfsProjectInfoPkgString);
                Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package));
                Assert.IsNotNull(package, "Package failed to load");
            });
        }
コード例 #14
0
        public void PackageLoadTest()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the Shell Service
                IVsShell shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;
                Assert.IsNotNull(shellService);

                //Validate package load
                IVsPackage package;
                Guid packageGuid = new Guid("C4128D99-2000-41D1-A6C3-704E6C1A3DE2");
                Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package));
                Assert.IsNotNull(package, "Package failed to load");
            });
        }
コード例 #15
0
        public void PackageLoadTest()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the Shell Service
                IVsShell shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;
                Assert.IsNotNull(shellService);

                //Validate package load
                IVsPackage package;
                Guid packageGuid = new Guid(FSharp.ProjectExtender.Constants.guidProjectExtenderPkgString);
                Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package));
                Assert.IsNotNull(package, "Package failed to load");
            });
        }
コード例 #16
0
        public void PackageLoadTest()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the Shell Service
                IVsShell shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;
                Assert.IsNotNull(shellService);

                //Validate package load
                IVsPackage package;
                Guid packageGuid = new Guid("f152487e-9a22-4cf9-bee6-a8f7c77f828d");
                Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package));
                Assert.IsNotNull(package, "Package failed to load");
            });
        }
コード例 #17
0
        public void PackageLoadTest()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the Shell Service
                IVsShell shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;
                Assert.IsNotNull(shellService);

                //Validate package load
                IVsPackage package;
                Guid packageGuid = new Guid(JosePedroSilva.TFSScrumExtensions.GuidList.guidTFSScrumExtensionsPkgString);
                Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package));
                Assert.IsNotNull(package, "Package failed to load");
            });
        }
コード例 #18
0
        public void PackageLoadTest()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the Shell Service
                IVsShell shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;
                Assert.IsNotNull(shellService);

                //Validate package load
                IVsPackage package;
                Guid packageGuid = new Guid(GeoCybernetica.CodeGenerationExtention.GuidList.guidCodeGenerationExtentionPkgString);
                Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package));
                Assert.IsNotNull(package, "Package failed to load");
            });
        }
コード例 #19
0
        public void PackageLoadTest()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the Shell Service
                IVsShell shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;
                Assert.IsNotNull(shellService);

                //Validate package load
                IVsPackage package;
                Guid packageGuid = new Guid(ALMRangers.TracepointGeneratorPackage.GuidList.guidTracepointGenerator_PackagePkgString);
                Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package));
                Assert.IsNotNull(package, "Package failed to load");
            });
        }
コード例 #20
0
        public void CppWinformsApplication()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate
            {
                //Solution and project creation parameters
                const string solutionName = "CPPWinApp";
                const string projectName  = "CPPWinApp";

                //Template parameters
                const string projectType = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}";
                var projectTemplateName  = Path.Combine("vcNet", "mc++appwiz.vsz");

                const string itemTemplateName = "newc++file.cpp";
                const string newFileName      = "Test.cpp";

                var dte = (DTE)VsIdeTestHostContext.ServiceProvider.GetService(typeof(DTE));

                var testUtils = new TestUtils();

                testUtils.CreateEmptySolution(TestContext.TestDir, solutionName);
                Assert.AreEqual(0, testUtils.ProjectCount());

                //Add new CPP Windows application project to existing solution
                var solutionDirectory   = Directory.GetParent(dte.Solution.FullName).FullName;
                var projectDirectory    = TestUtils.GetNewDirectoryName(solutionDirectory, projectName);
                var projectTemplatePath = Path.Combine(dte.Solution.TemplatePath[projectType],
                                                       projectTemplateName);
                Assert.IsTrue(File.Exists(projectTemplatePath),
                              string.Format("Could not find template file: {0}", projectTemplatePath));
                dte.Solution.AddFromTemplate(projectTemplatePath, projectDirectory, projectName);

                //Verify that the new project has been added to the solution
                Assert.AreEqual(1, testUtils.ProjectCount());

                //Get the project
                Project project = dte.Solution.Item(1);
                Assert.IsNotNull(project);
                Assert.IsTrue(string.Compare(project.Name, projectName, StringComparison.InvariantCultureIgnoreCase) ==
                              0);

                //Verify Adding new code file to project
                string newItemTemplatePath = Path.Combine(dte.Solution.ProjectItemsTemplatePath(projectType),
                                                          itemTemplateName);
                Assert.IsTrue(File.Exists(newItemTemplatePath));
                ProjectItem item = project.ProjectItems.AddFromTemplate(newItemTemplatePath, newFileName);
                Assert.IsNotNull(item);
            });
        }
コード例 #21
0
        public void TestGetAutomationObject()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the global service provider and the dte
                IServiceProvider sp = VsIdeTestHostContext.ServiceProvider;
                DTE dte             = (DTE)sp.GetService(typeof(DTE));

                string destination  = Path.Combine(TestContext.TestDir, TestContext.TestName);
                ProjectNode project = Utilities.CreateMyNestedProject(sp, dte, TestContext.TestName, destination, true);

                object retValue = project.GetAutomationObject();

                Assert.IsNotNull(retValue);
            });
        }
コード例 #22
0
ファイル: BaseTest.cs プロジェクト: forki/VisualFStar
 public void MyTestCleanup()
 {
     UIThreadInvoker.Invoke((ThreadInvoker) delegate()
     {
         IVsSolution solutionService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution)) as IVsSolution;
         if (solutionService != null)
         {
             object isOpen;
             solutionService.GetProperty((int)__VSPROPID.VSPROPID_IsSolutionOpen, out isOpen);
             if ((bool)isOpen)
             {
                 solutionService.CloseSolutionElement((uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_ForceSave, null, 0);
             }
         }
     });
 }
コード例 #23
0
        public void PackageLoadTest()
        {
            UIThreadInvoker.Invoke(new Action(() =>
            {
                // Get the Shell Service
                var shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell;
                Assert.IsNotNull(shellService);

                // Validate package load
                IVsPackage package;
                var packageGuid = new Guid(PackageGuids.GuidCodeMaidPackageString);

                Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package));
                Assert.IsNotNull(package, "Package failed to load");
            }));
        }
コード例 #24
0
        public void InitializeContext()
        {
            this.testClass = new ValidationTest();

            // Exports test class to MEF
            VsCompositionContainer.Create(new TypeCatalog(typeof(ValidationTest)), new VsExportProviderSettings(
                                              VsExportProvidingPreference.BeforeExportsFromOtherContainers));

            this.solution = VsIdeTestHostContext.ServiceProvider.GetService <ISolution>();
            this.solution.CreateInstance(this.DeploymentDirectory, "Blank");

            this.patternManager = VsIdeTestHostContext.ServiceProvider.GetService <IPatternManager>();
            var toolkit = this.patternManager.InstalledToolkits.Single(f => f.Id == "NuPattern.Runtime.IntegrationTests.TestToolkit");

            UIThreadInvoker.Invoke(new Action(() => this.product = this.patternManager.CreateProduct(toolkit, "Foo")));
        }
コード例 #25
0
        public void TestHasProjectOpened()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the global service provider and the dte
                IServiceProvider sp = VsIdeTestHostContext.ServiceProvider;
                DTE dte             = (DTE)sp.GetService(typeof(DTE));

                string destination  = Path.Combine(TestContext.TestDir, TestContext.TestName);
                ProjectNode project = Utilities.CreateMyNestedProject(sp, dte, TestContext.TestName, destination, true);

                PropertyInfo pi       = typeof(ProjectNode).GetProperty("HasProjectOpened", BindingFlags.Instance | BindingFlags.NonPublic);
                bool hasProjectOpened = (bool)pi.GetValue(project, new object[] { });
                Assert.IsTrue(hasProjectOpened, "The event listener for opening the project has failed");
            });
        }
コード例 #26
0
        public void TestTargetsOnUserProject()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the global service provider and the dte
                IServiceProvider sp = VsIdeTestHostContext.ServiceProvider;
                DTE dte             = (DTE)sp.GetService(typeof(DTE));

                string mainProject = CreateTempFileOnDisk(@"                
			                   
								 <Project DefaultTargets=`Build`  xmlns=`msbuildnamespace`>
									<Import Project=`$(MSBuildBinPath)\Microsoft.CSharp.targets`/>
							   </Project>
							"                            );

                ProjectShim mainProjectShim            = null;
                UserProjectSecurityChecker userProject = null;
                try
                {
                    mainProjectShim = CreateProjectShim(mainProject);
                    userProject     = CreateUserProjectSecurityChecker(sp, @"
			                
								<Project DefaultTargets=`Build`  xmlns=`msbuildnamespace`>                      
								 <Target
										Name=`PrepareForBuild`>
										<PropertyGroup>
											<TargetDir>$(TargetDir)</TargetDir>
											<TargetPath>$(TargetPath)</TargetPath>
										</PropertyGroup>
								 </Target>           
							   </Project>
							"                            , mainProjectShim);

                    MethodInfo mi    = userProject.GetType().GetMethod("IsProjectSafeWithTargets", BindingFlags.Instance | BindingFlags.NonPublic);
                    string[] message = new string[1] {
                        String.Empty
                    };
                    bool result = (bool)mi.Invoke(userProject, message);

                    Assert.IsTrue(!result && !String.IsNullOrEmpty(message[0]), "A user project redefined targets and was not considered unsafe.");
                }
                finally
                {
                    TestProjectForSecurity.CleanUp(userProject, mainProjectShim);
                }
            });
        }
コード例 #27
0
ファイル: TestNode.cs プロジェクト: zqb971/android-plus-plus
        public void TestCreatingFileNode()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the global service provider and the dte
                IServiceProvider sp = VsIdeTestHostContext.ServiceProvider;
                DTE dte             = (DTE)sp.GetService(typeof(DTE));

                string destination  = Path.Combine(TestContext.TestDir, TestContext.TestName);
                ProjectNode project = Utilities.CreateMyNestedProject(sp, dte, TestContext.TestName, destination, true);

                string newFileName  = TestUtils.GetNewFileName(project.ProjectFolder, "test", "cs");
                ProjectElement item = project.CreateMsBuildFileItem(newFileName, "Compile");
                FileNode node       = project.CreateFileNode(item);
                Assert.IsNotNull(node);
            });
        }
コード例 #28
0
        public void TestProjectCreationWithDTE()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the global service provider and the dte
                IServiceProvider sp = VsIdeTestHostContext.ServiceProvider;
                DTE dte             = (DTE)sp.GetService(typeof(DTE));

                string destination  = Path.Combine(TestContext.TestDir, TestContext.TestName);
                ProjectNode project = Utilities.CreateMyNestedProject(sp, dte, TestContext.TestName, destination, true);

                // test nested project item
                EnvDTE.ProjectItem nestedProject = ((OAProject)project.GetAutomationObject()).ProjectItems.Item("ANestedProject");

                Assert.IsNotNull(nestedProject, "Failed to retrieve nested projects");

                Assert.IsNotNull(nestedProject.SubProject, "Failed to retrieve nested projects's subproject");

                // Add a cs file to the nested project.
                string newFileName = Path.GetFullPath(TestUtils.GetNewFileName(project.ProjectFolder, "GetClassWithCodeModel", "cs"));

                EnvDTE.ProjectItem newFile = nestedProject.SubProject.ProjectItems.AddFromFile(newFileName);
                CodeModel codeModel        = nestedProject.SubProject.CodeModel;
                Assert.IsNotNull(codeModel, "Failed to retrieve nested projects's subproject");

                FileCodeModel fileCodeModel = newFile.FileCodeModel;

                CodeClass cc = fileCodeModel.AddClass("MyClass", 0, null, null, vsCMAccess.vsCMAccessPublic);

                IEnumerator enumerator = fileCodeModel.CodeElements.GetEnumerator();

                bool found = false;
                while (enumerator.MoveNext())
                {
                    CodeElement element = enumerator.Current as CodeElement;

                    if (element.Name == "MyClass")
                    {
                        found = true;
                        break;
                    }
                }

                Assert.IsTrue(found, "Could not find the class in the code model associated to the nested project");
            });
        }
コード例 #29
0
        public void InsideSameFolder()
        {
            //"Program3.fs"
            //"Folder1\\File3.fs"
            //"Folder1\\File4.fs"
            //"Folder1\\Sub1\File2.fs"
            //"Folder1\\Sub1\\SubSub1\\File1.fs"
            //"Folder1\\Sub2\\File1.fs"
            //"Folder1\\File1.fs"
            //"Folder2\\File1.fs"
            //"Program.fs"
            //"Program2.fs"
            //"Folder3\\CompileFile1.fs",
            //"Folder3\\ContentFile1.fs",
            //"Folder3\\NoneFile1.fs"

            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //"It'd be more optimal if root level files won't be swapped in this tests.
                //But they are swapped (manual check,not yet automized)
                new SwapConfig("InsideSameFolder", ref testContext)
                .Move(
                    new MoveOp {
                    Index = 1, Dir = CompileOrderViewer.Direction.Down
                },
                    new MoveOp {
                    Index = 3, Dir = CompileOrderViewer.Direction.Down
                })
                .ExpectedOrder(
                    "Program3.fs",
                    "Folder1\\File4.fs",
                    "Folder1\\File3.fs",
                    "Folder1\\Sub1\\SubSub1\\File1.fs",
                    "Folder1\\Sub1\\File2.fs",
                    "Folder1\\Sub2\\File1.fs",
                    "Folder1\\File1.fs",
                    "Folder2\\File1.fs",
                    "Program.fs",
                    "Program2.fs",
                    "Folder3\\CompileFile1.fs"                    //,
                    //"Folder3\\ContentFile1.fs",
                    //"Folder3\\NoneFile1.fs"
                    )
                .Run();
            });
        }
コード例 #30
0
ファイル: Misc.cs プロジェクト: dbremner/nupattern
        public void WhenShowingMessage_ThenSucceeds()
        {
            var components = (IComponentModel)Package.GetGlobalService(typeof(SComponentModel));
            var service    = (IServiceProvider)components.GetService <SVsServiceProvider>();
            var ui         = (IVsUIShell)service.GetService(typeof(SVsUIShell));

            Assert.NotNull(service);
            Assert.NotNull(ui);

            using (var purger = new DialogBoxPurger(0))
            {
                UIThreadInvoker.Invoke((Action)(() =>
                {
                    PackageUtility.ShowError(service, "Foo", string.Empty);
                }));
            }
        }