示例#1
0
        public void SingleLineArg()
        {
            FeatureRunner.Given_the_Feature_is(
                @"
Scenario: Name
Step with ""Arg1"" and ""Arg2""
");
            HighlightFeature.Raconteur_should_highlight_like_a("String", 1, "\"Arg1\"");
            HighlightFeature.Raconteur_should_highlight_like_a("String", 1, "\"Arg2\"");
        }
示例#2
0
        public void SimpleArgs()
        {
            FeatureRunner.Given_the_Feature_is(
                @"
Feature: Arg Types
Scenario: Use string instead of int
Given the zipcode is ""33131""
");
            FeatureRunner.The_Runner_should_contain(
                @"
Given_the_zipcode_is(""33131"");
");
        }
示例#3
0
        public void DefaultStepDefinition()
        {
            FeatureRunner.Given_the_Feature_is(
                @"
Feature: Reusing Steps

Scenario: Reuse a Step
Step
");
            FeatureRunner.The_Runner_should_contain(
                @"
[TestMethod]
public void ReuseAStep()
{
Step();
}
");
        }
示例#4
0
        public void FeatureAndScenarios()
        {
            FeatureRunner.Given_the_Feature_is(
                @"
Feature: Name
Scenario: First
Scenario: Second
");
            HighlightFeature.Raconteur_should_highlight(1, "Feature:", "Keyword");
            HighlightFeature.Raconteur_should_highlight(2, "Scenario:", "Keyword");
        }
示例#5
0
        public void FeatureAndScenarios()
        {
            FeatureRunner.Given_the_Feature_is(
                @"
Feature: Name
using Step Definitions
Scenario: First
using after Scenario
");
            HighlightFeature.Raconteur_should_highlight_like_a("Comment", "using Step Definitions");
            HighlightFeature.Raconteur_should_not_highlight("using after Scenario");
        }
示例#6
0
        public void TablePassedAsAnArray()
        {
            FeatureRunner.Given_the_Feature_is(
                @"
Feature: Table Types
Scenario: Scenario Name
Given some values:
|0|1|
|1|1|
");
            FeatureRunner.The_Runner_should_contain(
                @"
[TestMethod]
public void ScenarioName()
{
Given_some_values_
(
new[] {""0"", ""1""},
new[] {""1"", ""1""}
);
}
");
        }
        public void MbUnitRunner()
        {
            Using("MbUnit");
            FeatureRunner.Given_the_Feature_is(
                @"
Feature: Feature
Scenario: Scenario
");
            FeatureRunner.The_Runner_should_be(
                @"
using MbUnit.Framework;
namespace Features
{
[TestFixture]
public partial class Feature
{
[Test]
public void Scenario()
{
}
}
}
");
        }
示例#8
0
        public void GenerateRunnerClass()
        {
            FeatureRunner.Given_the_Feature_is(
                @"
Feature: Feature Name
");
            FeatureRunner.The_Runner_should_be(
                @"
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Features
{
[TestClass]
public partial class FeatureName
{
}
}
");
        }
示例#9
0
        public void QueVivaEspaña_YOlé_()
        {
            Select_language("es");
            FeatureRunner.Given_the_Feature_is(
                @"
Funcionalidad: Multilingue
Escenario: En Español
");
            FeatureRunner.The_Runner_should_contain(
                @"
[TestClass]
public partial class Multilingue
{
[TestMethod]
public void EnEspañol()
{
}
}
");
        }
示例#10
0
        public void ScenariosWithTags()
        {
            FeatureRunner.Given_the_Feature_is(
                @"
Feature: Name
Scenario: First
Steps
@tag
Scenario: Second
Steps
");
            Raconteur_should_allow_to_collapse(
                @"
Scenario: First
Steps
");
            Raconteur_should_allow_to_collapse(
                @"
Scenario: Second
Steps
");
        }
示例#11
0
 public void SuggestionsFromBaseClass()
 {
     FeatureRunner.Given_the_Feature_is("Feature: Intellisense");
     When_I_begin_to_type__on_the_next_line("In");
     Then__should_be_displayed("Inherited Step");
 }
示例#12
0
 public void UnparseableFeature()
 {
     FeatureRunner.Given_the_Feature_is("unparseable feature");
     FeatureRunner.The_Runner_should_be("Missing Feature declaration");
 }
示例#13
0
 void Given_the_Feature_is_Empty()
 {
     FeatureRunner.Given_the_Feature_is(string.Empty);
 }