当前位置: 首页>>代码示例>>C#>>正文


C# IProject.GetPersistentID方法代码示例

本文整理汇总了C#中IProject.GetPersistentID方法的典型用法代码示例。如果您正苦于以下问题:C# IProject.GetPersistentID方法的具体用法?C# IProject.GetPersistentID怎么用?C# IProject.GetPersistentID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IProject的用法示例。


在下文中一共展示了IProject.GetPersistentID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetOrCreateTestClass

        public XunitTestClassElement GetOrCreateTestClass(IProject project, IClrTypeName typeName, string assemblyLocation, MultiValueDictionary<string, string> traits)
        {
            var categories = GetCategories(traits);

            // dotCover displays the ids of covering tests, rather than a more presentable
            // name. That makes the "xunit" and project identifiers rather ugly. Fortunately,
            // dotCover will ignore any text in square brackets
            var id = string.Format("[xunit:{0}]{1}", project.GetPersistentID(), typeName.FullName);
            var element = unitTestManager.GetElementById(project, id);
            if (element != null)
            {
                element.State = UnitTestElementState.Valid;
                var classElement = element as XunitTestClassElement;
                if (classElement != null)   // Shouldn't be null, unless someone else has the same id
                {
                    classElement.AssemblyLocation = assemblyLocation;   // In case it's changed, e.g. someone's switched from Debug to Release
                    classElement.SetCategories(categories);
                }
                return classElement;
            }

            return new XunitTestClassElement(provider, new ProjectModelElementEnvoy(project), declaredElementProvider, id, typeName.GetPersistent(), assemblyLocation, categories);
        }
开发者ID:EddieGarmon,项目名称:resharper-xunit,代码行数:23,代码来源:UnitTestElementFactory.cs

示例2: GetOrCreateInheritedTestMethodContainer

        public XunitInheritedTestMethodContainerElement GetOrCreateInheritedTestMethodContainer(IProject project, IClrTypeName typeName, string methodName)
        {
            // See the comment in GetOrCreateTestClass re: dotCover showing ids instead of names.
            // This element never becomes a genuine test element, so dotCover will never see it,
            // but keep the id format the same
            var id = string.Format("[xunit:{0}]{1}.{2}", project.GetPersistentID(), typeName.FullName, methodName);
            var element = unitTestManager.GetElementById(project, id);
            if (element != null)
                return element as XunitInheritedTestMethodContainerElement;

            return new XunitInheritedTestMethodContainerElement(provider, new ProjectModelElementEnvoy(project), id, typeName.GetPersistent(), methodName);
        }
开发者ID:EddieGarmon,项目名称:resharper-xunit,代码行数:12,代码来源:UnitTestElementFactory.cs

示例3: GetClassElementId

 private static string GetClassElementId(IProject project, IClrTypeName typeName)
 {
     var id = string.Format("fixie:{0}:{1}", project.GetPersistentID(), typeName.FullName);
     return id;
 }
开发者ID:TylerCarlson1,项目名称:ReSharperFixieRunner,代码行数:5,代码来源:UnitTestElementFactory.cs


注:本文中的IProject.GetPersistentID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。