Пример #1
0
        public void FindOrCreateSolutionFolder()
        {
            MockVSHierarchy hierarchy  = new MockVSHierarchy();
            MockVsSolution  solution   = new MockVsSolution(hierarchy);
            HierarchyNode   node       = new HierarchyNode(solution);
            string          folderName = "SlnItems";
            HierarchyNode   folder     = node.FindOrCreateSolutionFolder(folderName);

            Assert.IsNotNull(folder);
            Assert.AreEqual <string>(folderName, folder.Name);
        }
Пример #2
0
 private HierarchyNode InternalGetOrCreateMappingFile()
 {
     using (HierarchyNode root = new HierarchyNode(VSSolution))
     {
         HierarchyNode found = root.RecursiveFindByName(Helpers.Constants.MappingFile);
         if (found != null)
         {
             return(found);
         }
         using (found = root.FindOrCreateSolutionFolder(Helpers.Constants.SolutionItems))
         {
             return(found != null?found.FindByName(Helpers.Constants.MappingFile) : null);
         }
     }
 }
		public void FindOrCreateSolutionFolder()
		{
			MockVSHierarchy hierarchy = new MockVSHierarchy();
			MockVsSolution solution = new MockVsSolution(hierarchy);
			HierarchyNode node = new HierarchyNode(solution);
			string folderName = "SlnItems";
			HierarchyNode folder = node.FindOrCreateSolutionFolder(folderName);
			Assert.IsNotNull(folder);
			Assert.AreEqual<string>(folderName, folder.Name);
		}