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

C# UnitTestElement类代码示例

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

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



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

示例1: StorEvilProjectElement

 public StorEvilProjectElement(StorEvilTestProvider provider, UnitTestElement parent, IProject project,
     string title, IEnumerable<string> assemblies)
     : base(provider, parent, project, title)
 {
     Assemblies = assemblies;
     _namespace = new UnitTestNamespace(project.Name + ": StorEvil specifications");
 }
开发者ID:heinrichbreedt,项目名称:storevil,代码行数:7,代码来源:StorEvilProjectElement.cs


示例2: StorEvilScenarioElement

 public StorEvilScenarioElement(StorEvilTestProvider provider, UnitTestElement parent, IProject project,
                                string title, Scenario scenario)
     : base(provider, parent, project, title)
 {
     _namespace = new UnitTestNamespace(project.Name);
     Scenario = scenario;
 }
开发者ID:codereflection,项目名称:storevil,代码行数:7,代码来源:StorEvilScenarioElement.cs


示例3: BuildDisposition

        public static UnitTestElementDisposition BuildDisposition(UnitTestElement element, ScenarioLocation location, IProjectFile  projectFile)
        {
            var contents = File.ReadAllText(location.Path);
            var range = new TextRange(LineToOffset(contents, location.FromLine), LineToOffset(contents, location.ToLine));

            return new UnitTestElementDisposition(element, projectFile, range, new TextRange(0));
        }
开发者ID:paulbatum,项目名称:storevil,代码行数:7,代码来源:DispositionBuilder.cs


示例4: StorEvilUnitTestElement

 protected StorEvilUnitTestElement(IUnitTestProvider provider, UnitTestElement parent, IProject project,
                                string title)
     : base(provider, parent)
 {
     Project = project;
     _title = title;
 }
开发者ID:pawelpabich,项目名称:storevil,代码行数:7,代码来源:StorEvilUnitTestElement.cs


示例5: GetTasks

        public IList<UnitTestTask> GetTasks(UnitTestElement element, IList<UnitTestElement> explicitElements)
        {
            //if (!(element is StorEvilScenarioElement))
            //    return new List<UnitTestTask>();

            var tasks = new List<UnitTestTask>();

            if (element is StorEvilProjectElement)
            {
                var projectEl = element as StorEvilProjectElement;
                tasks.Add(new UnitTestTask(null, new LoadContextAssemblyTask(typeof(Scenario).Assembly.Location)));

                foreach (string assembly in projectEl.Assemblies)
                {
                    tasks.Add(new UnitTestTask(null, new LoadContextAssemblyTask(assembly)));
                }
                tasks.Add(GetProjectTask(projectEl, explicitElements));
            }

            if (element is StorEvilStoryElement)
            {
                tasks.Add(GetProjectTask(element.Parent as StorEvilProjectElement, explicitElements));
                tasks.Add(GetStoryTask(element as StorEvilStoryElement, explicitElements));
            }

            if (element is StorEvilScenarioElement)
            {
                tasks.Add(GetProjectTask(element.Parent.Parent as StorEvilProjectElement, explicitElements));
                tasks.Add(GetStoryTask(element.Parent as StorEvilStoryElement, explicitElements));
                tasks.Add(GetScenarioTask(element, explicitElements));
            }
            return tasks;
        }
开发者ID:pawelpabich,项目名称:storevil,代码行数:33,代码来源:StorEvilTaskFactory.cs


示例6: StorEvilStoryElement

 public StorEvilStoryElement(StorEvilTestProvider provider, UnitTestElement parent, IProject project, string title, ConfigSettings config, string id)
     : base(provider, parent, project, title)
 {
     Config = config;
     Id = id;
     _namespace = new UnitTestNamespace(project.Name + " " + title);
 }
开发者ID:codereflection,项目名称:storevil,代码行数:7,代码来源:StorEvilStoryElement.cs


示例7: Element

    protected Element(IUnitTestProvider provider,

                      UnitTestElement parent,
                      ProjectModelElementEnvoy projectEnvoy,
                      string declaringTypeName,
                      bool isIgnored)
      : base(provider, parent)
    {
      if (projectEnvoy == null && !Shell.Instance.IsTestShell)
      {
        throw new ArgumentNullException("projectEnvoy");
      }

      if (declaringTypeName == null)
      {
        throw new ArgumentNullException("declaringTypeName");
      }

      _projectEnvoy = projectEnvoy;
      _declaringTypeName = declaringTypeName;

      if (isIgnored)
      {
        SetExplicit("Ignored");
      }
    }
开发者ID:simonlaroche,项目名称:Simple.Testing,代码行数:26,代码来源:Element.cs


示例8: StorEvilScenarioOutlineElement

 public StorEvilScenarioOutlineElement(StorEvilTestProvider provider, UnitTestElement parent, IProject project,
                                       string title, ScenarioOutline scenarioOutline)
     : base(provider, parent, project, title)
 {
     _scenarioOutline = scenarioOutline;
     _namespace = new UnitTestNamespace(project.Name);
 }
开发者ID:pawelpabich,项目名称:storevil,代码行数:7,代码来源:StorEvilScenarioOutlineElement.cs


示例9: StorEvilStoryElement

        public StorEvilStoryElement(StorEvilTestProvider provider, UnitTestElement parent, IProject project, string title, string path)
            : base(provider, parent, project, title)
        {
            _path = path;

            _namespace = new UnitTestNamespace(project.Name + " " + title);
        }
开发者ID:pawelpabich,项目名称:storevil,代码行数:7,代码来源:StorEvilStoryElement.cs


示例10: AddStoryElement

        private void AddStoryElement(Story story, IProject project,
            UnitTestElementConsumer consumer, UnitTestElement parent)
        {
            var storyElement = GetStoryElement(parent, project, story);
            consumer(storyElement);

            foreach (IScenario scenario in story.Scenarios)
                AddScenarioElement(project, consumer, storyElement, scenario);
        }
开发者ID:paulbatum,项目名称:storevil,代码行数:9,代码来源:StorEvilAssemblyExplorer.cs


示例11: GetTaskSequence

    public IList<UnitTestTask> GetTaskSequence(UnitTestElement element, IList<UnitTestElement> explicitElements)
    {
      if (element is ContextSpecificationElement)
      {
        var contextSpecification = element as ContextSpecificationElement;
        var context = contextSpecification.Context;

        return new List<UnitTestTask>
               {
                 _taskFactory.CreateAssemblyLoadTask(context),
                 _taskFactory.CreateContextTask(context, explicitElements.Contains(context)),
                 _taskFactory.CreateContextSpecificationTask(context,
                                                             contextSpecification,
                                                             explicitElements.Contains(contextSpecification))
               };
      }

      if (element is BehaviorElement)
      {
        var behavior = element as BehaviorElement;
        var context = behavior.Context;

        return new List<UnitTestTask>
               {
                 _taskFactory.CreateAssemblyLoadTask(context),
                 _taskFactory.CreateContextTask(context, explicitElements.Contains(context)),
                 _taskFactory.CreateBehaviorTask(context, behavior, explicitElements.Contains(behavior))
               };
      }

      if (element is BehaviorSpecificationElement)
      {
        var behaviorSpecification = element as BehaviorSpecificationElement;
        var behavior = behaviorSpecification.Behavior;
        var context = behavior.Context;

        return new List<UnitTestTask>
               {
                 _taskFactory.CreateAssemblyLoadTask(context),
                 _taskFactory.CreateContextTask(context, explicitElements.Contains(context)),
                 _taskFactory.CreateBehaviorTask(context,
                                                 behavior,
                                                 explicitElements.Contains(behavior)),
                 _taskFactory.CreateBehaviorSpecificationTask(context,
                                                              behaviorSpecification,
                                                              explicitElements.Contains(behaviorSpecification))
               };
      }

      if (element is ContextElement)
      {
        return EmptyArray<UnitTestTask>.Instance;
      }

      throw new ArgumentException(String.Format("Element is not a Machine.Specifications element: '{0}'", element));
    }
开发者ID:rho24,项目名称:machine.specifications,代码行数:56,代码来源:MSpecUnitTestProvider.cs


示例12: StorEvilStoryElement

        public StorEvilStoryElement(StorEvilTestProvider provider, UnitTestElement parent, IProject project, string title, string path)
            : base(provider, parent, project, title)
        {
            _path = path;

            var root = project.Location.ToDirectoryInfo().FullName;
            var pathPieces = PathHelper.GetRelativePathPieces(root, _path);
            var pathJoined = project.Name + " " + string.Join(" - ", pathPieces);
            _namespace = new UnitTestNamespace(pathJoined + title);
        }
开发者ID:heinrichbreedt,项目名称:storevil,代码行数:10,代码来源:StorEvilStoryElement.cs


示例13: IsOfKind

        public bool IsOfKind(UnitTestElement element, UnitTestElementKind elementKind)
        {
            if (element is StorEvilScenarioElement)
                return elementKind == UnitTestElementKind.Test;

            if (element is StorEvilStoryElement || element is StorEvilProjectElement)
                return elementKind == UnitTestElementKind.TestContainer;

            return false;
        }
开发者ID:pawelpabich,项目名称:storevil,代码行数:10,代码来源:StorEvilElementComparer.cs


示例14: FieldElement

 protected FieldElement(IUnitTestProvider provider,
                        UnitTestElement parent,
                        IProjectModelElement project,
                        string declaringTypeName,
                        string fieldName,
                        bool isIgnored)
   : base(provider, parent, project, declaringTypeName, isIgnored || parent.IsExplicit)
 {
   _fieldName = fieldName;
 }
开发者ID:BarryWoods,项目名称:machine.specifications,代码行数:10,代码来源:FieldElement.cs


示例15: FieldElement

 protected FieldElement(IUnitTestProvider provider,
                        UnitTestElement parent,
                        IProjectModelElement project,
                        string declaringTypeName,
                        string fieldName,
                        bool isIgnored)
   : base(provider, parent, project, declaringTypeName, isIgnored || parent.IsExplicit)
 {
   _fieldName = fieldName;
   AssignCategories(parent.GetCategories().Select(x => x.Name).ToList());
 }
开发者ID:jhollingworth,项目名称:machine.specifications,代码行数:11,代码来源:FieldElement.cs


示例16: CompareUnitTestElements

        public int CompareUnitTestElements(UnitTestElement x, UnitTestElement y)
        {
            if (x is StorEvilStoryElement && y is StorEvilStoryElement)
                return ((StorEvilStoryElement)x).Id == ((StorEvilStoryElement)y).Id ? 0 : -1;

            if (x is StorEvilScenarioElement && y is StorEvilScenarioElement)
                return ((StorEvilScenarioElement)x).Scenario.Id.CompareTo(((StorEvilScenarioElement)y).Scenario.Id);

            if (x is StorEvilProjectElement && y is StorEvilProjectElement)
                return x.GetNamespace().NamespaceName.CompareTo(y.GetNamespace().NamespaceName);

            return -1;
        }
开发者ID:pawelpabich,项目名称:storevil,代码行数:13,代码来源:StorEvilElementComparer.cs


示例17: CreateContainerElements

        private void CreateContainerElements(IExampleContainer[] exampleContainers, UnitTestElement parent)
        {
            foreach (var exampleContainer in exampleContainers)
            {
                var element = new ExampleContainerElement(_provider, _project, parent, (ExampleContainer)exampleContainer);
                _consumer(element);

                CreateContainerElements(exampleContainer.ExampleContainers, element);

                foreach (var example in exampleContainer.Examples)
                    _consumer(new ExampleElement(_provider, element, _project, (Example)example));

            }
        }
开发者ID:davidmfoley,项目名称:bickle,代码行数:14,代码来源:ElementFactory.cs


示例18: Present

        public void Present(UnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state)
        {
            item.RichText = element.GetTitle();

            var standardImage = GetImage(element);
            var stateImage = UnitTestManager.GetStateImage(state);
            if (stateImage != null)
            {
                item.Images.Add(stateImage);
            }
            else if (standardImage != null)
            {
                item.Images.Add(standardImage);
            }
        }
开发者ID:davidmfoley,项目名称:bickle,代码行数:15,代码来源:BickleElementPresenter.cs


示例19: Present

        public void Present(UnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state)
        {
            var testElement = element as StorEvilUnitTestElement;
            if (testElement == null)
                return;

            item.RichText = element.ShortName;

            Image standardImage = UnitTestManager.GetStandardImage(UnitTestElementImage.Test);
            Image stateImage = UnitTestManager.GetStateImage(state);
            if (stateImage != null)
            {
                item.Images.Add(stateImage);
            }
            else if (standardImage != null)
            {
                item.Images.Add(standardImage);
            }
        }
开发者ID:pawelpabich,项目名称:storevil,代码行数:19,代码来源:StorEvilUnitTestPresenter.cs


示例20: Present

 public void Present(UnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state)
 {
     Presenter.UpdateItem(element, node, item, state);
 }
开发者ID:simonlaroche,项目名称:machine,代码行数:4,代码来源:MSpecUnitTestProvider.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# UnitTestElementConsumer类代码示例发布时间:2022-05-24
下一篇:
C# UnitSelectionDelegate类代码示例发布时间: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