Skip to content

Commit

Permalink
added integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
szaliszali committed Oct 6, 2018
1 parent c17344b commit 5899d0f
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 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,69 @@ 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 the following step definition
"""
[When(@".*")]
public void When___()
{
throw new System.Reflection.ReflectionTypeLoadException(
new System.Type[3],
new[]
{
new System.Exception("crash"),
new System.Exception("boom"),
new System.Exception("bang"),
});
}
"""
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'

Scenario: ReflectionTypeLoaderException in a static constructor
Given the following class
"""
public class Class1
{
static Class1()
{
throw new System.Reflection.ReflectionTypeLoadException(
new System.Type[3],
new[]
{
new System.Exception("crash"),
new System.Exception("boom"),
new System.Exception("bang"),
});
}
}
"""
And there is a feature file in the project as
"""
Feature: f
Scenario: s
When ...
"""
And the following step definition
"""
[When(@".*")]
public void When___()
{
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(typeof(Class1).TypeHandle);
}
"""
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'

0 comments on commit 5899d0f

Please sign in to comment.