當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。