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


C# UnitTestElement类代码示例

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


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


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