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


C# IUnitTestElement.GetType方法代码示例

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


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

示例1: 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

示例2: 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

示例3: SerializeElement

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

            var specificationElement = element as JasmineSpecificationElement;
            if (specificationElement != null)
            {
                specificationElement.WriteToXml(parent);
                return;
            }

            if (!(element is JasmineSuiteElement))
            {
                throw new ArgumentException(string.Format("Element {0} is not Jasmine", element.GetType()));
            }

            ((JasmineSuiteElement)element).WriteToXml(parent);
        }
开发者ID:sergeyt,项目名称:karma-resharper,代码行数:18,代码来源:JasmineElementSerializer.cs

示例4: 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

示例5: Equals

    public bool Equals(IUnitTestElement other)
    {
      if (ReferenceEquals(this, other))
      {
        return true;
      }

      if (other.GetType() == GetType())
      {
        var element = (Element) other;
        return other.ShortName == ShortName
               && other.Provider == Provider
               && Equals(element._projectEnvoy, _projectEnvoy)
               && element._declaringTypeName == _declaringTypeName;
      }
      return false;
    }
开发者ID:kropp,项目名称:machine.specifications,代码行数:17,代码来源:Element.cs

示例6: SerializeElement

 public void SerializeElement(XmlElement xmlElement, IUnitTestElement element)
 {
     xmlElement.SetAttribute(c_elementType, element.GetType().FullName);
       xmlElement.SetAttribute(c_absoluteId, element.Id);
       xmlElement.SetAttribute(c_projectId, ((ITestElement) element).GetProject().AssertNotNull().GetPersistentID());
       xmlElement.SetAttribute(c_text, element.GetPresentation());
       xmlElement.SetAttribute(c_categories, element.Categories.Select(x => x.Name).Join("|"));
 }
开发者ID:igor-toporet,项目名称:TestFx,代码行数:8,代码来源:TestElementSerializer.cs

示例7: Equals

        public bool Equals(IUnitTestElement other)
        {
            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (other.GetType() == this.GetType())
            {
                var element = (Element)other;
                string thisFullName;
                string otherFullName;
                try
                {
                    // This might throw for invalid elements.
                    thisFullName = this._declaringTypeName.FullName;
                    otherFullName = element._declaringTypeName.FullName;
                }
                catch (NullReferenceException)
                {
                    return false;
                }

                return Equals(other.Id, this.Id)
                       && other.ShortName == this.ShortName
                       && Equals(element._projectEnvoy, this._projectEnvoy)
                       && thisFullName == otherFullName;
            }
            return false;
        }
开发者ID:JAllman,项目名称:machine.specifications.runner.resharper,代码行数:30,代码来源:Element.cs

示例8: Equals

        public virtual bool Equals(IUnitTestElement other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }
            if (ReferenceEquals(this, other))
            {
                return true;
            }
            if (other.GetType() != GetType())
            {
                return false;
            }

            return Equals(ProjectFileEnvoy, ((Element)other).ProjectFileEnvoy) &&
                   string.Equals(ShortName, other.ShortName) &&
                   Equals(Parent, other.Parent);
        }
开发者ID:sergeyt,项目名称:karma-resharper,代码行数:19,代码来源:Element.cs


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