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); }
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"); }
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); }
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); }