Skip to content

Commit

Permalink
added an integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
szaliszali committed Oct 6, 2018
1 parent c17344b commit d952430
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Tests/TechTalk.SpecFlow.IntegrationTests/Features/Tracing.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,17 @@ Scenario: Preserves step keywords in trace
When I execute the tests
Then the execution log should contain text 'Angenommen ich Knopf 1 drücke'
And the execution log should contain text 'Gegeben sei ich Knopf 2 drücke'

Scenario: ReflectionTypeLoaderException in a step binding
Given there is a feature file in the project as
"""
Feature: f
Scenario: s
When ...
"""
And all 'When' steps are bound and throw a ReflectionTypeLoaderException
When I execute the tests
Then the execution log should contain text '--> error: Type Loader exceptions:'
And the execution log should contain text '--> error: LoaderException: System.Exception: crash'
And the execution log should contain text '--> error: LoaderException: System.Exception: boom'
And the execution log should contain text '--> error: LoaderException: System.Exception: bang'
8 changes: 8 additions & 0 deletions Tests/TechTalk.SpecFlow.Specs/StepDefinitions/BindingSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ public void GivenAllStepsAreBoundAndFail(ScenarioBlock scenarioBlock)
inputProjectDriver.AddStepBinding(scenarioBlock, ".*", "throw new System.Exception(\"simulated failure\");", "Throw new System.Exception(\"simulated failure\")");
}

[Given(@"all '(.*)' steps are bound and throw a ReflectionTypeLoaderException")]
public void GivenAllStepsAreBoundAndThrowAReflectionTypeLoaderException(ScenarioBlock scenarioBlock)
{
inputProjectDriver.AddStepBinding(scenarioBlock, ".*",
"throw new System.Reflection.ReflectionTypeLoadException(new System.Type[3], new[] { new System.Exception(\"crash\"), new System.Exception(\"boom\"), new System.Exception(\"bang\"), });",
"Throw New System.Reflection.ReflectionTypeLoadException(New System.Type(2) {}, {New System.Exception(\"crash\"), New System.Exception(\"boom\"), New System.Exception(\"bang\")})");
}

[Given(@"all '(.*)' steps are bound and pass")]
public void GivenAllStepsAreBoundAndPass(ScenarioBlock scenarioBlock)
{
Expand Down

0 comments on commit d952430

Please sign in to comment.