• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IUnitTestElement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IUnitTestElement的典型用法代码示例。如果您正苦于以下问题:C# IUnitTestElement类的具体用法?C# IUnitTestElement怎么用?C# IUnitTestElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IUnitTestElement类属于命名空间,在下文中一共展示了IUnitTestElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ReadFromXml

    public static IUnitTestElement ReadFromXml(XmlElement parent, IUnitTestElement parentElement, MSpecUnitTestProvider provider, ISolution solution
#if RESHARPER_61
      , IUnitTestElementManager manager, PsiModuleManager psiModuleManager, CacheManager cacheManager
#endif
      )
    {
      var projectId = parent.GetAttribute("projectId");
      var project = ProjectUtil.FindProjectElementByPersistentID(solution, projectId) as IProject;
      if (project == null)
      {
        return null;
      }

      var behavior = parentElement as BehaviorElement;
      if (behavior == null)
      {
        return null;
      }

      var typeName = parent.GetAttribute("typeName");
      var methodName = parent.GetAttribute("methodName");
      var isIgnored = bool.Parse(parent.GetAttribute("isIgnored"));

      return BehaviorSpecificationFactory.GetOrCreateBehaviorSpecification(provider,
#if RESHARPER_61
        manager, psiModuleManager, cacheManager,
#endif
        project, behavior, ProjectModelElementEnvoy.Create(project), typeName, methodName, isIgnored);
    }
开发者ID:rho24,项目名称:machine.specifications,代码行数:29,代码来源:BehaviorSpecificationElement.cs


示例2: ReadFromXml

    public static IUnitTestElement ReadFromXml(XmlElement parent,
                                               IUnitTestElement parentElement,
                                               ISolution solution,
                                               BehaviorSpecificationFactory factory)
    {
      var projectId = parent.GetAttribute("projectId");
      var project = ProjectUtil.FindProjectElementByPersistentID(solution, projectId) as IProject;
      if (project == null)
      {
        return null;
      }

      var behavior = parentElement as BehaviorElement;
      if (behavior == null)
      {
        return null;
      }

      var typeName = parent.GetAttribute("typeName");
      var methodName = parent.GetAttribute("methodName");
      var isIgnored = bool.Parse(parent.GetAttribute("isIgnored"));

      return factory.GetOrCreateBehaviorSpecification(behavior,
                                                      new ClrTypeName(typeName),
                                                      methodName,
                                                      isIgnored);
    }
开发者ID:hennys,项目名称:machine.specifications,代码行数:27,代码来源:BehaviorSpecificationElement.cs


示例3: DeserializeElement

    public IUnitTestElement DeserializeElement(XmlElement parent, IUnitTestElement parentElement)
    {
      var typeName = parent.GetAttribute("elementType");

      if (Equals(typeName, "ContextElement"))
      {
        return ContextElement.ReadFromXml(parent,
                                          _solution,
                                          _contextFactory);
      }
      if (Equals(typeName, "BehaviorElement"))
      {
        return BehaviorElement.ReadFromXml(parent,
                                           parentElement,
                                           _solution,
                                           _behaviorFactory);
      }
      if (Equals(typeName, "BehaviorSpecificationElement"))
      {
        return BehaviorSpecificationElement.ReadFromXml(parent,
                                                        parentElement,
                                                        _solution,
                                                        _behaviorSpecificationFactory);
      }
      if (Equals(typeName, "ContextSpecificationElement"))
      {
        return ContextSpecificationElement.ReadFromXml(parent,
                                                       parentElement,
                                                       _solution,
                                                       _contextSpecificationFactory);
      }

      return null;
    }
开发者ID:hennys,项目名称:machine.specifications,代码行数:34,代码来源:MSpecUnitTestElementSerializer.cs


示例4: Equals

 public bool Equals(IUnitTestElement other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     if (!(other is SilverlightUnitTestElement)) return false;
     return Equals(other.Id, Id);
 }
开发者ID:garyjohnson,项目名称:AgUnit,代码行数:7,代码来源:SilverlightUnitTestElement.cs


示例5: GallioTestElementBase

 	protected GallioTestElementBase(IUnitTestRunnerProvider provider, string id, IUnitTestElement parent)
     {
 		Provider = provider;
 		Id = id;
 		Parent = parent;
 		children = new List<IUnitTestElement>();
     }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:GallioTestElementBase.cs


示例6: ReadFromXml

    public static IUnitTestElement ReadFromXml(XmlElement parent, IUnitTestElement parentElement, MSpecUnitTestProvider provider)
    {
      var projectId = parent.GetAttribute("projectId");
      var project = ProjectUtil.FindProjectElementByPersistentID(provider.Solution, projectId) as IProject;
      if (project == null)
      {
        return null;
      }

      var context = parentElement as ContextElement;
      if (context == null)
      {
        return null;
      }

      var typeName = parent.GetAttribute("typeName");
      var methodName = parent.GetAttribute("methodName");
      var isIgnored = bool.Parse(parent.GetAttribute("isIgnored"));
      var fullyQualifiedTypeName = parent.GetAttribute("typeFQN");

      return Factories.BehaviorFactory.GetOrCreateBehavior(provider,
                                                           project,
                                                           ProjectModelElementEnvoy.Create(project),
                                                           context,
                                                           typeName,
                                                           methodName,
                                                           isIgnored,
                                                           fullyQualifiedTypeName);
    }
开发者ID:ChrisEdwards,项目名称:machine.specifications,代码行数:29,代码来源:BehaviorElement.cs


示例7: Present

 public void Present(IUnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state)
 {
     if (element is Element)
     {
         this._presenter.UpdateItem(element, node, item, state);
     }
 }
开发者ID:JAllman,项目名称:machine.specifications.runner.resharper,代码行数:7,代码来源:MSpecUnitTestPresenter.cs


示例8: ReadFromXml

    public static IUnitTestElement ReadFromXml(XmlElement parent, IUnitTestElement parentElement, MSpecUnitTestProvider provider, ISolution solution
#if RESHARPER_61
      , IUnitTestElementManager manager, PsiModuleManager psiModuleManager, CacheManager cacheManager
#endif
      )
    {
      var projectId = parent.GetAttribute("projectId");
      var project = ProjectUtil.FindProjectElementByPersistentID(solution, projectId) as IProject;
      if (project == null)
      {
        return null;
      }

      var context = parentElement as ContextElement;
      if (context == null)
      {
        return null;
      }

      var typeName = parent.GetAttribute("typeName");
      var methodName = parent.GetAttribute("methodName");
      var isIgnored = bool.Parse(parent.GetAttribute("isIgnored"));

      return ContextSpecificationFactory.GetOrCreateContextSpecification(provider,
#if RESHARPER_61
                manager, psiModuleManager, cacheManager,
#endif
                project, context, ProjectModelElementEnvoy.Create(project), new ClrTypeName(typeName), methodName, EmptyArray<string>.Instance, isIgnored);
    }
开发者ID:kropp,项目名称:machine.specifications,代码行数:29,代码来源:ContextSpecificationElement.cs


示例9: SerializeElement

            public void SerializeElement(XmlElement parent, IUnitTestElement element)
            {
                parent.SetAttribute("type", element.GetType().Name);

                var writableUnitTestElement = (ISerializableUnitTestElement)element;
                writableUnitTestElement.WriteToXml(parent);
            }
开发者ID:briandonahue,项目名称:simple-testing,代码行数:7,代码来源:SimpleTestingElementSerializer.cs


示例10: AssertTestMethod

 private static XunitTestMethodElement AssertTestMethod(IUnitTestElement unitTestElement, string shortName)
 {
     Assert.IsInstanceOf<XunitTestMethodElement>(unitTestElement);
     Assert.AreEqual(shortName, unitTestElement.ShortName);
     Assert.AreEqual(UnitTestElementState.Valid, unitTestElement.State);
     return (XunitTestMethodElement) unitTestElement;
 }
开发者ID:hazzik,项目名称:ReSharper.XUnitTestRunner,代码行数:7,代码来源:XunitFileExplorerTests.cs


示例11: AssertTestClass

 private static XunitTestClassElement AssertTestClass(IUnitTestElement unitTestElement, object shortName)
 {
     Assert.IsInstanceOf<XunitTestClassElement>(unitTestElement);
     Assert.AreEqual(shortName, unitTestElement.ShortName);
     Assert.AreEqual(UnitTestElementState.Valid, unitTestElement.State);
     return (XunitTestClassElement) unitTestElement;
 }
开发者ID:hazzik,项目名称:ReSharper.XUnitTestRunner,代码行数:7,代码来源:XunitFileExplorerTests.cs


示例12: GetRuntimeEnvironment

 public RuntimeEnvironment GetRuntimeEnvironment(
     IUnitTestElement element,
     RuntimeEnvironment projectRuntimeEnvironment,
     TargetPlatform targetPlatform,
     IUnitTestLaunch launch)
 {
     return new RuntimeEnvironment { PlatformType = PlatformType.x86, PlatformVersion = PlatformVersion.v4_0 };
 }
开发者ID:icnocop,项目名称:AgUnit,代码行数:8,代码来源:SilverlightRunStrategy.cs


示例13: SerializeElement

 public void SerializeElement(XmlElement parent, IUnitTestElement element)
 {
   var e = element as ISerializableElement;
   if (e != null)
   {
     e.WriteToXml(parent);
     parent.SetAttribute("elementType", e.GetType().Name);
   }
 }
开发者ID:simonlaroche,项目名称:Simple.Testing,代码行数:9,代码来源:TestProvider.cs


示例14: Present

 public void Present(IUnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state)
 {
     // We only want to customise how class elements are displayed. If the
     // parent node isn't a namespace, and isn't the namespace of the class,
     // display the class as namespace qualified
     if (!(element is XunitTestClassElement))
         return;
     treePresenter.UpdateItem(element, node, item, state);
 }
开发者ID:EddieGarmon,项目名称:resharper-xunit,代码行数:9,代码来源:XunitTestClassPresenter.cs


示例15: DeserializeElement

        public IUnitTestElement DeserializeElement(XmlElement parent, IUnitTestElement parentElement)
        {
            if (SilverlightUnitTestElement.CanDeserialize(parent))
            {
                return SilverlightUnitTestElement.Deserialize(parent, this);
            }

            throw new ArgumentOutOfRangeException();
        }
开发者ID:staxmanade,项目名称:AgUnit,代码行数:9,代码来源:SilverlightUnitTestProvider.cs


示例16: SerializeElement

        public void SerializeElement(XmlElement parent, IUnitTestElement element)
        {
            parent.SetAttribute("type", element.GetType().Name);

            // Make sure that the element is actually ours before trying to serialise it
            // This can happen if there are two providers with the same "xunit" id installed
            var writableUnitTestElement = element as ISerializableUnitTestElement;
            if (writableUnitTestElement != null)
                writableUnitTestElement.WriteToXml(parent);
        }
开发者ID:Booksbaum,项目名称:resharper-xunit,代码行数:10,代码来源:XunitTestElementSerializer.cs


示例17: SerializeElement

 public void SerializeElement(XmlElement parent, IUnitTestElement element)
 {
     parent.SetAttribute("type", element.GetType().Name);
     
     var testElement = element as XunitTestElementBase;
     if (testElement == null)
         throw new ArgumentException(string.Format("Element {0} is not MSTest", element.GetType()), "element");
     
     testElement.WriteToXml(parent);
 }
开发者ID:hazzik,项目名称:ReSharper.XUnitTestRunner,代码行数:10,代码来源:XunitTestElementSerializer.cs


示例18: DeserializeElement

        public IUnitTestElement DeserializeElement(XmlElement parent, IUnitTestElement parentElement)
        {
            if (!parent.HasAttribute("type"))
                throw new ArgumentException("Element is not Fixie");

            Func<XmlElement, IUnitTestElement, ISolution, UnitTestElementFactory, IUnitTestElement> func;
            if (DeserialiseMap.TryGetValue(parent.GetAttribute("type"), out func))
                return func(parent, parentElement, solution, unitTestElementFactory);

            throw new ArgumentException("Element is not Fixie");
        }
开发者ID:TylerCarlson1,项目名称:ReSharperFixieRunner,代码行数:11,代码来源:TestElementSerializer.cs


示例19: DeserializeElement

            public IUnitTestElement DeserializeElement(XmlElement parent, IUnitTestElement parentElement)
            {
                if (!parent.HasAttribute("type"))
                    throw new ArgumentException("Element has no Type attribute");

                ReadFromXmlFunc func;
                if (DeserialiseMap.TryGetValue(parent.GetAttribute("type"), out func))
                    return func(parent, parentElement, _solution, _unitTestElementFactory);

                throw new ArgumentException("Element has no Type attribute");
            }
开发者ID:briandonahue,项目名称:simple-testing,代码行数:11,代码来源:SimpleTestingElementSerializer.cs


示例20: TestMethodElement

        public TestMethodElement(TestProvider provider, IUnitTestElement parent, ProjectModelElementEnvoy projectModelElementEnvoy,
            DeclaredElementProvider declaredElementProvider, string id, IClrTypeName typeName, string methodName, string assemblyLocation, bool isParameterized)
            : base(provider, typeName, assemblyLocation, parent, id, projectModelElementEnvoy)
        {
            this.declaredElementProvider = declaredElementProvider;
            this.methodName = methodName;
            IsParameterized = isParameterized;

            ShortName = methodName;
            presentation = string.Format("{0}.{1}", typeName.ShortName, methodName);
        }
开发者ID:TylerCarlson1,项目名称:ReSharperFixieRunner,代码行数:11,代码来源:TestMethodElement.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IUnitTestProvider类代码示例发布时间:2022-05-24
下一篇:
C# IUnitOfWorkRepository类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap