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