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

Commit

Permalink
Fix missing IUnitTestRuntimeProvider (#85)
Browse files Browse the repository at this point in the history
Fixes: #73
  • Loading branch information
mbhoek authored May 7, 2022
1 parent cc72c8d commit cc8f75c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
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

0 comments on commit cc8f75c

Please sign in to comment.