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

Commit

Permalink
Add ISpecFlowOutputHelper test (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhoek authored May 22, 2022
1 parent cc8f75c commit 074d885
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Feature: ISpecFlowOutputHelper
Issue #75: ITestOutputHelper unavailable when using SpecFlow.xUnit
https://github.com/solidtoken/SpecFlow.DependencyInjection/issues/75

Scenario: Assert ISpecFlowOutputHelper Is Available
The When part here is purely for displaying the message using ISpecFlowOutputHelper
When a message is output using ISpecFlowOutputHelper
Then verify that ISpecFlowOutputHelper is correctly injected
34 changes: 34 additions & 0 deletions SpecFlow.DependencyInjection.Tests/ISpecFlowOutputHelperSteps.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TechTalk.SpecFlow;
using TechTalk.SpecFlow.Infrastructure;
using Xunit;

namespace SolidToken.SpecFlow.DependencyInjection.Tests
{
[Binding]
public class ISpecFlowOutputHelperSteps
{
private readonly ISpecFlowOutputHelper _output;

public ISpecFlowOutputHelperSteps(ISpecFlowOutputHelper output)
{
_output = output;
}

[When(@"a message is output using ISpecFlowOutputHelper")]
public void WhenAMessageIsOutputUsingISpecFlowOutputHelper()
{
_output.WriteLine("This is output from ISpecFlowOutputHelper");
}

[Then(@"verify that ISpecFlowOutputHelper is correctly injected")]
public void ThenVerifyThatISpecFlowOutputHelperIsCorrectlyInjected()
{
Assert.NotNull(_output);
}
}
}
4 changes: 1 addition & 3 deletions SpecFlow.DependencyInjection.Tests/TestDependencies.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;

namespace SolidToken.SpecFlow.DependencyInjection.Tests
{
Expand Down

0 comments on commit 074d885

Please sign in to comment.