Skip to content
This repository was archived by the owner on May 22, 2024. It is now read-only.

Commit 074d885

Browse files
authored
Add ISpecFlowOutputHelper test (#87)
1 parent cc8f75c commit 074d885

File tree

3 files changed

+43
-3
lines changed

3 files changed

+43
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Feature: ISpecFlowOutputHelper
2+
Issue #75: ITestOutputHelper unavailable when using SpecFlow.xUnit
3+
https://github.com/solidtoken/SpecFlow.DependencyInjection/issues/75
4+
5+
Scenario: Assert ISpecFlowOutputHelper Is Available
6+
The When part here is purely for displaying the message using ISpecFlowOutputHelper
7+
When a message is output using ISpecFlowOutputHelper
8+
Then verify that ISpecFlowOutputHelper is correctly injected
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using TechTalk.SpecFlow;
7+
using TechTalk.SpecFlow.Infrastructure;
8+
using Xunit;
9+
10+
namespace SolidToken.SpecFlow.DependencyInjection.Tests
11+
{
12+
[Binding]
13+
public class ISpecFlowOutputHelperSteps
14+
{
15+
private readonly ISpecFlowOutputHelper _output;
16+
17+
public ISpecFlowOutputHelperSteps(ISpecFlowOutputHelper output)
18+
{
19+
_output = output;
20+
}
21+
22+
[When(@"a message is output using ISpecFlowOutputHelper")]
23+
public void WhenAMessageIsOutputUsingISpecFlowOutputHelper()
24+
{
25+
_output.WriteLine("This is output from ISpecFlowOutputHelper");
26+
}
27+
28+
[Then(@"verify that ISpecFlowOutputHelper is correctly injected")]
29+
public void ThenVerifyThatISpecFlowOutputHelperIsCorrectlyInjected()
30+
{
31+
Assert.NotNull(_output);
32+
}
33+
}
34+
}

SpecFlow.DependencyInjection.Tests/TestDependencies.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using System.Linq;
3-
using Microsoft.Extensions.DependencyInjection;
1+
using Microsoft.Extensions.DependencyInjection;
42

53
namespace SolidToken.SpecFlow.DependencyInjection.Tests
64
{

0 commit comments

Comments
 (0)