Ejemplo n.º 1
0
        public void Should_create_table_instance_from_string()
        {
            var columnNames  = new ExampleColumns(new[] { new ExampleColumn("colA"), new ExampleColumn("colB"), });
            var columnValues = new Dictionary <string, string> {
                { "colA", "A" }, { "colB", "B" }
            };
            var example = new Example(columnNames, columnValues);

            var str = example.ToString();
            var exampleFromString = ExampleBuilder.BuildFromString(str);

            CollectionAssert.AreEqual(exampleFromString.ColumnNames, example.ColumnNames);
            CollectionAssert.AreEqual(exampleFromString.ColumnValues, example.ColumnValues);
        }
Ejemplo n.º 2
0
        public NBehaveExampleParentTask(XmlElement element)
            : base(element)
        {
            FeatureFile = GetXmlAttribute(element, "featureFile");
            Scenario    = GetXmlAttribute(element, "scenario");
            int nrOfExamples = int.Parse(GetXmlAttribute(element, "examples"));
            var examples     = new List <Example>();

            for (int i = 0; i < nrOfExamples; i++)
            {
                Example e = ExampleBuilder.BuildFromString(GetXmlAttribute(element, "example_" + i));
                examples.Add(e);
            }
            Examples = examples;
        }