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

Fix missing IUnitTestRuntimeProvider #85

Merged
merged 1 commit into from
May 7, 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,6 @@
Feature: UnitTestRuntimeProvider
Issue #73: Unable to resolve IUnitTestRuntimeProvider
https://github.com/solidtoken/SpecFlow.DependencyInjection/issues/73

Scenario: Assert IUnitTestRuntimeProvider is available
Then verify that IUnitTestRuntimeProvider is correctly injected
28 changes: 28 additions & 0 deletions SpecFlow.DependencyInjection.Tests/UnitTestRuntimeProviderSteps.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TechTalk.SpecFlow;
using TechTalk.SpecFlow.UnitTestProvider;
using Xunit;

namespace SolidToken.SpecFlow.DependencyInjection.Tests
{
[Binding]
public class UnitTestRuntimeProviderSteps
{
private readonly IUnitTestRuntimeProvider _unitTestRuntimeProvider;

public UnitTestRuntimeProviderSteps(IUnitTestRuntimeProvider unitTestRuntimeProvider)
{
_unitTestRuntimeProvider = unitTestRuntimeProvider;
}

[Then(@"verify that IUnitTestRuntimeProvider is correctly injected")]
public void ThenVerifyThatIUnitTestRuntimeProviderIsCorrectlyInjected()
{
Assert.NotNull(_unitTestRuntimeProvider);
}
}
}
1 change: 1 addition & 0 deletions SpecFlow.DependencyInjection/DependencyInjectionPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ private static void RegisterProxyBindings(IObjectContainer objectContainer, ISer
services.AddSingleton(sp => objectContainer.Resolve<IStepTextAnalyzer>());
services.AddSingleton(sp => objectContainer.Resolve<IRuntimePluginLoader>());
services.AddSingleton(sp => objectContainer.Resolve<IBindingAssemblyLoader>());
services.AddSingleton(sp => objectContainer.Resolve<IUnitTestRuntimeProvider>());

services.AddTransient(sp =>
{
Expand Down