public given_a_template_conversion_request_with_drilled_down_scenarios_only()
 {
     _request =
         new ConvertTemplateToCSharpRequest(
             new FileInfo("./data/Scenario1.feature"),
             "SomeNamespace",
             new[]
     {
         "Given the Maker has started a game with the word silky",
         "\tWhen the Breaker joins the Maker's game",
         "\t\tThen the Breaker must guess a word with 5 characters"
     }
             );
 }
 public given_multiple_given_when_then_in_a_feature_with_blank_line()
 {
     _request = new ConvertTemplateToCSharpRequest(
         new FileInfo("MultipleSiteSupport.feature"),
         "Tests",
         new[]
     {
         "Given I am logged in as Dr. Bill",
         "  When I try to post to \"Expensive Therapy\"",
         "    Then I should see \"Your article was published.\"",
         "  When I try to post to \"Greg's anti-tax rants\"",
         "    Then I should see \"Hey! That's not your blog!\"",
         "",
         "Given I am logged in as Greg",
         "  When I try to post to \"Expensive Therapy\"",
         "    Then I should see \"Your article was published.\""
     }
         );
 }
Exemple #3
0
        private void ConvertTemplateToCSharp(FileInfo featureFile, string @namespace)
        {
            var convertTemplateToCSharpRequest = new ConvertTemplateToCSharpRequest(
                featureFile,
                @namespace,
                File.ReadAllLines(featureFile.FullName)
                );

            var csharpSourceCode = _convertTemplateToCSharpHandler.Handle(
                convertTemplateToCSharpRequest,
                null
                );

            var csharpSourceCodeFilePath = Path.Combine(
                featureFile.DirectoryName,
                featureFile.NameWithoutExtension() + "Test.cs"
                );

            File.WriteAllText(csharpSourceCodeFilePath, csharpSourceCode);

            Console.WriteLine("info: C# source code is generated at " + csharpSourceCodeFilePath);
        }