コード例 #1
0
 public JsonFeatureWithMetaInfo(FeatureNode featureNodeTreeNode, TestResult result)
 {
     var jsonMapper = new JsonMapper();
     this.Feature = jsonMapper.Map(featureNodeTreeNode.Feature);
     this.RelativeFolder = featureNodeTreeNode.RelativePathFromRoot;
     this.Result = jsonMapper.Map(result);
 }
コード例 #2
0
        public void TableRowWithCells_Always_ConvertsToJsonTableRow()
        {
            var tableRow = new TableRow { Cells = { "cell 1", "cell 2" } };

            var jsonMapper = new JsonMapper();

            JsonTableRow jsonTableRow = jsonMapper.Map(tableRow);

            Check.That(jsonTableRow).ContainsExactly("cell 1", "cell 2");
        }
コード例 #3
0
        public void TableRowWithTestResult_Always_ConvertsToJsonTableRowWithTestResult()
        {
            var tableRow = new TableRow { Result = TestResult.Passed };

            var jsonMapper = new JsonMapper();

            JsonTableRow jsonTableRow = jsonMapper.Map(tableRow);

            Check.That(jsonTableRow.Result.WasExecuted).IsEqualTo(true);
            Check.That(jsonTableRow.Result.WasSuccessful).IsEqualTo(true);
        }
コード例 #4
0
        public void MapToScenario_Always_MapsFeatureProperty()
        {
            var feature = new Feature
                              {
                                  Name = "My Feature",
                                  Description = "My Description",
                                  FeatureElements = { new Scenario { Name = "My Feature" } }
                              };

            var mapper = new JsonMapper();

            var mappedFeature = mapper.Map(feature);

            Check.That(mappedFeature.FeatureElements.Count).IsEqualTo(1);

            var mappedScenario = mappedFeature.FeatureElements[0] as JsonScenario;

            Check.That(mappedScenario.Feature).IsSameReferenceThan(mappedFeature);
        }