public void Should_read_in_feature_description_without_blank_prefix() { var reader = new FeatureReader(BufferedReaderBuilder.ReadIn("Feature: Ording answers")); Feature feature = reader.Read(); Assert.That(feature.Description, Is.EqualTo("Ording answers")); }
public void Should_read_in_feature_description_with_multi_lines_format() { var reader = new FeatureReader(BufferedReaderBuilder.ReadIn( "Feature: Ording answers", " about voting" )); Feature feature = reader.Read(); Assert.That(feature.Description, Is.EqualTo("Ording answers\tabout voting")); }
public void Should_read_in_scenario() { var reader = new FeatureReader(BufferedReaderBuilder.ReadIn( "Feature: Ording answers", "Scenario: The answer with the highest vote gets to the top" )); Feature feature = reader.Read(); Assert.That(feature.Scenarios.Count, Is.EqualTo(1)); Assert.That(feature.Scenarios[0].Description, Is.EqualTo("The answer with the highest vote gets to the top")); }
public void Should_ignore_blank_line() { var reader = new FeatureReader(BufferedReaderBuilder.ReadIn( "Feature: Ording answers", " ", // Blank spaces " ", // Tab "Scenario: The answer with the highest vote gets to the top" )); Feature feature = reader.Read(); Assert.That(feature.Scenarios.Count, Is.EqualTo(1)); }
private static float[][] LoadDescriptorFile(string descriptorFile) { using (FeatureReader featureReader = new FeatureReader(descriptorFile, false)) //using (FeatureReader featureReader = new FeatureReader(descriptorFile, true)) { Console.WriteLine("Loading {0} descriptors ({1} dimensions).", featureReader.FeatureCount, featureReader.FeatureDimension); float[][] descriptors = new float[featureReader.FeatureCount][]; for (int i = 0; i < featureReader.FeatureCount; i++) { descriptors[i] = featureReader.GetFeatures(i); } return(descriptors); } }
public void Should_read_in_multi_scenarios() { var featureDesc = new StringBuilder(); featureDesc.AppendLine("Feature: Ording answers"); featureDesc.AppendLine("Scenario: The answer with the highest vote gets to the top"); featureDesc.AppendLine("Scenario: The answer with the lowest vote gets to the bottom"); var reader = new FeatureReader(BufferedReaderBuilder.ReadIn( "Feature: Ording answers", "Scenario: The answer with the highest vote gets to the top", "Scenario: The answer with the lowest vote gets to the bottom" )); Feature feature = reader.Read(); Assert.That(feature.Scenarios.Count, Is.EqualTo(2)); Assert.That(feature.Scenarios[0].Description, Is.EqualTo("The answer with the highest vote gets to the top")); Assert.That(feature.Scenarios[1].Description, Is.EqualTo("The answer with the lowest vote gets to the bottom")); }
/// <summary> /// Read features from feature file. /// </summary> /// <param name="featureFilePath">The feature file path.</param> public void ReadFeatures(string featureFilePath) { this.Features = FeatureReader.Read(featureFilePath).ToArray(); this.FeatureFilePath = featureFilePath; this.SetFeatures(); }