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


C# ObjectModel.Feature类代码示例

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


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

示例1: ThenCanFormatMarkdownTableExtensions

    public void ThenCanFormatMarkdownTableExtensions()
    {
      var feature = new Feature
      {
        Name = "A feature",
        Description =
@"In order to see the description as nice HTML
As a Pickles user
I want to see the descriptions written in markdown rendered with tables

| Table Header 1 | Table Header 2 |
| -------------- | -------------- |
| Cell value 1   | Cell value 2   |
| Cell value 3   |                |
| Cell value 4   | Cell value 5   |
"
      };

      var htmlFeatureFormatter = Container.Resolve<HtmlFeatureFormatter>();
      XElement featureElement = htmlFeatureFormatter.Format(feature);
      XElement description = featureElement.Elements().FirstOrDefault(element => element.Name.LocalName == "div");

      Check.That(description).IsNotNull();
      Check.That(description).IsNamed("div");
      Check.That(description).IsInNamespace("http://www.w3.org/1999/xhtml");
      Check.That(description).HasAttribute("class", "description");

      XElement table = description.Descendants().FirstOrDefault(el => el.Name.LocalName == "table");

      Check.That(table).IsNotNull();
    }
开发者ID:testpulse,项目名称:pickles,代码行数:31,代码来源:WhenFormattingFeatures.cs

示例2: FeatureNode

 public FeatureNode(FileSystemInfoBase location, string relativePathFromRoot, Feature feature)
 {
     this.OriginalLocation = location;
     this.OriginalLocationUrl = location.ToUri();
     this.RelativePathFromRoot = relativePathFromRoot;
     this.Feature = feature;
 }
开发者ID:MikeThomas64,项目名称:pickles,代码行数:7,代码来源:FeatureNode.cs

示例3: Then_feature_without_background_adds_first_scenario_on_correct_row

        public void Then_feature_without_background_adds_first_scenario_on_correct_row()
        {
            var excelFeatureFormatter = Container.Resolve<ExcelFeatureFormatter>();

            var feature = new Feature
                              {
                                  Name = "Test Feature",
                                  Description =
                                      "In order to test this feature,\nAs a developer\nI want to test this feature",
                              };
            var scenario = new Scenario
            {
                Name = "Test Scenario",
                Description =
                    "In order to test this scenario,\nAs a developer\nI want to test this scenario"
            };
            var given = new Step { NativeKeyword = "Given", Name = "a precondition" };
            scenario.Steps = new List<Step>(new[] { given });
            feature.AddFeatureElement(scenario);

            using (var workbook = new XLWorkbook())
            {
                IXLWorksheet worksheet = workbook.AddWorksheet("SHEET1");
                excelFeatureFormatter.Format(worksheet, feature);

                Check.That(worksheet.Cell("B4").Value).IsEqualTo(scenario.Name);
                Check.That(worksheet.Cell("C5").Value).IsEqualTo(scenario.Description);
                Check.That(worksheet.Cell("D6").Value).IsEqualTo(given.Name);
            }
        }
开发者ID:testpulse,项目名称:pickles,代码行数:30,代码来源:WhenAddingAFeatureToAWorksheet.cs

示例4: Then_feature_with_background_is_added_successfully

        public void Then_feature_with_background_is_added_successfully()
        {
            var excelFeatureFormatter = Container.Resolve<ExcelFeatureFormatter>();

            var feature = new Feature
            {
                Name = "Test Feature",
                Description =
                    "In order to test this feature,\nAs a developer\nI want to test this feature",
            };
            var background = new Scenario
            {
                Name = "Test Background Scenario",
                Description =
                    "In order to test this background,\nAs a developer\nI want to test this background"
            };
            var given = new Step { NativeKeyword = "Given", Name = "a precondition" };
            background.Steps = new List<Step>(new[] { given });
            feature.AddBackground(background);

            using (var workbook = new XLWorkbook())
            {
                IXLWorksheet worksheet = workbook.AddWorksheet("SHEET1");
                excelFeatureFormatter.Format(worksheet, feature);

                Check.That(worksheet.Cell("B4").Value).IsEqualTo(background.Name);
                Check.That(worksheet.Cell("C5").Value).IsEqualTo(background.Description);
                Check.That(worksheet.Cell("D6").Value).IsEqualTo(given.Name);
            }
        }
开发者ID:picklesdoc,项目名称:pickles,代码行数:30,代码来源:WhenAddingAFeatureToAWorksheet.cs

示例5: Map

        public JsonFeature Map(Feature feature)
        {
            if (feature == null)
            {
                return null;
            }

            var result = new JsonFeature
            {
                Name = feature.Name,
                Description = feature.Description,
                Result = this.resultMapper.Map(feature.Result),
                Tags = feature.Tags.ToArray().ToList(),
            };

            result.FeatureElements.AddRange(feature.FeatureElements.Select(this.MapFeatureElement).ToList());
            result.Background = this.scenarioMapper.Map(feature.Background);

            if (result.Background != null)
            {
                result.Background.Feature = result;
            }

            foreach (var featureElement in result.FeatureElements)
            {
                featureElement.Feature = result;
            }

            return result;
        }
开发者ID:ngm,项目名称:pickles,代码行数:30,代码来源:FeatureToJsonFeatureMapper.cs

示例6: GetFeatureElement

 protected override XElement GetFeatureElement(Feature feature)
 {
     return this.resultsDocument
         .Descendants("test-suite")
         .Where(x => x.Attribute("description") != null)
         .FirstOrDefault(x => x.Attribute("description").Value == feature.Name);
 }
开发者ID:picklesdoc,项目名称:pickles,代码行数:7,代码来源:NUnit2SingleResults.cs

示例7: Setup

        public void Setup()
        {
            this.testFeature = new Feature { Name = "Test" };
            this.featureFileInfo = this.FileSystem.FileInfo.FromFileName(FileSystem.Path.Combine(RootPath, FeaturePath));
            this.featureDirectoryNode = new FeatureNode(this.featureFileInfo, RelativePath, this.testFeature);

            this.featureWithMeta = new JsonFeatureWithMetaInfo(this.featureDirectoryNode);
        }
开发者ID:picklesdoc,项目名称:pickles,代码行数:8,代码来源:WhenCreatingAFeatureWithMetaInfo.cs

示例8: GetScenariosForFeature

        /// <summary>
        /// Retrieves all UnitTest XElements that belong to the specified feature.
        /// </summary>
        /// <param name="feature">The feature for which to retrieve the unit tests.</param>
        /// <returns>A sequence of <see cref="XElement" /> instances that are called "UnitTest"
        /// that belong to the specified feature.</returns>
        private IEnumerable<XElement> GetScenariosForFeature(Feature feature)
        {
            var scenarios = from scenario in this.resultsDocument.AllScenarios()
                            where scenario.HasPropertyFeatureTitle(feature.Name)
                            select scenario;

            return scenarios;
        }
开发者ID:picklesdoc,项目名称:pickles,代码行数:14,代码来源:MsTestSingleResults.cs

示例9: Setup

        public void Setup()
        {
            this._testFeature = new Feature { Name = "Test" };
            this._featureFileInfo = this.FileSystem.FileInfo.FromFileName(FileSystem.Path.Combine(ROOT_PATH, FEATURE_PATH));
            this._featureDirectoryNode = new FeatureNode(this._featureFileInfo, RELATIVE_PATH, this._testFeature);

            this._featureWithMeta = new FeatureWithMetaInfo(this._featureDirectoryNode);
        }
开发者ID:testpulse,项目名称:pickles,代码行数:8,代码来源:when_creating_a_feature_with_meta_info.cs

示例10: GetFeatureResult

        public TestResult GetFeatureResult(Feature feature)
        {
            var featureElement = this.GetFeatureElement(feature);
            int passedCount = featureElement.passed;
            int failedCount = featureElement.failed;
            int skippedCount = featureElement.skipped;

            return GetAggregateResult(passedCount, failedCount, skippedCount);
        }
开发者ID:robert-fahey,项目名称:pickles,代码行数:9,代码来源:XUnit2SingleResults.cs

示例11: GetFeatureResult

        public TestResult GetFeatureResult(Feature feature)
        {
            XElement featureElement = this.GetFeatureElement(feature);
            int passedCount = int.Parse(featureElement.Attribute("passed").Value);
            int failedCount = int.Parse(featureElement.Attribute("failed").Value);
            int skippedCount = int.Parse(featureElement.Attribute("skipped").Value);

            return GetAggregateResult(passedCount, failedCount, skippedCount);
        }
开发者ID:Jaykul,项目名称:pickles,代码行数:9,代码来源:XUnitSingleResults.cs

示例12: Map_SomeFeature_ReturnsJsonFeature

        public void Map_SomeFeature_ReturnsJsonFeature()
        {
            var feature = new Feature();

            var mapper = CreateMapper();

            var actual = mapper.Map(feature);

            Check.That(actual).IsNotNull();
        }
开发者ID:picklesdoc,项目名称:pickles,代码行数:10,代码来源:FeatureToJsonFeatureMapperTests.cs

示例13: GetFeatureResult

        public override TestResult GetFeatureResult(Feature feature)
        {
            var scenarios = this.GetScenariosForFeature(feature);

            var featureExecutionIds = scenarios.ExecutionIdElements();

            TestResult result = this.GetExecutionResult(featureExecutionIds);

            return result;
        }
开发者ID:picklesdoc,项目名称:pickles,代码行数:10,代码来源:MsTestSingleResults.cs

示例14: Map_FeatureWithName_ReturnsName

        public void Map_FeatureWithName_ReturnsName()
        {
            var feature = new Feature { Name = "Name of the Feature" };

            var mapper = CreateMapper();

            var actual = mapper.Map(feature);

            Check.That(actual.Name).IsEqualTo("Name of the Feature");
        }
开发者ID:picklesdoc,项目名称:pickles,代码行数:10,代码来源:FeatureToJsonFeatureMapperTests.cs

示例15: Map_FeatureWithDescription_ReturnsDescription

        public void Map_FeatureWithDescription_ReturnsDescription()
        {
            var feature = new Feature { Description = "As a math idiot" };

            var mapper = CreateMapper();

            var actual = mapper.Map(feature);

            Check.That(actual.Description).IsEqualTo("As a math idiot");
        }
开发者ID:picklesdoc,项目名称:pickles,代码行数:10,代码来源:FeatureToJsonFeatureMapperTests.cs


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