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

Add ISpecFlowOutputHelper test #87

Merged
merged 3 commits into from
May 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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