public void ShouldReadSampleFileCorrectly()
        {
            Assert.AreEqual(2, manager.GetMappingTableNames().Count);

            ProjectMappingTable table = manager.GetMappingTable("WCF");

            Assert.AreEqual(4, table.ProjectMappings.Count);

            ProjectMappingEntry entry = table.ProjectMappings[0];

            Assert.AreEqual("4A216B22-B2B2-4851-AFFA-B7A5AF147645", entry.ProjectId);
            Assert.AreEqual(@"\", entry.ProjectPath);
            Assert.AreEqual(2, entry.Roles.Count);
            Assert.AreEqual("DataContractRole", entry.Roles[0].Name);
        }
Пример #2
0
 private void TraverseHierarchyNode(HierarchyNode node)
 {
     node.RecursiveForEach(delegate(HierarchyNode child)
     {
         // recurse if this node is a Solution Folder
         if (child.TypeGuid != SolutionFolderGuid)
         {
             // If this is a project, add the mapping
             if (child.ExtObject is EnvDTE.Project)
             {
                 Collection <Role> roles = GetRoles(child.ExtObject as Project);
                 if (child.ProjectGuid != Guid.Empty)
                 {
                     ProjectMappingEntry mapping = new ProjectMappingEntry(child.ProjectGuid, ProjectPath, roles, child.Name);
                     manager.AddProjectMappingEntry(mappingTableName, mapping);
                     this.Trace(Resources.MappingTableAddedMessage, TraceEventType.Information, child.Name, mappingTableName, roles.Count);
                 }
             }
         }
     });
 }