-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...ConcreteTypeDynamicRegistrations_is_not_working_with_MicrosoftDependencyInjectionRules.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using NUnit.Framework; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using DryIoc.Microsoft.DependencyInjection; | ||
|
||
namespace DryIoc.IssuesTests | ||
{ | ||
[TestFixture] | ||
public class GHIssue555_ConcreteTypeDynamicRegistrations_is_not_working_with_MicrosoftDependencyInjectionRules : ITest | ||
{ | ||
public int Run() | ||
{ | ||
Test1(); | ||
return 1; | ||
} | ||
|
||
[Test] | ||
public void Test1() | ||
{ | ||
var rules = Rules | ||
.MicrosoftDependencyInjectionRules | ||
.WithConcreteTypeDynamicRegistrations(reuse: Reuse.Transient); | ||
|
||
var container = new Container(rules); | ||
|
||
// container with MS.DI rules should not be cloned | ||
var msDi = new DryIocServiceProviderFactory(container); | ||
var msDiContainer = msDi.CreateBuilder(new ServiceCollection()); | ||
// Assert.AreSame(container, msDiContainer); // todo: @fixme | ||
} | ||
|
||
public interface IServiceA | ||
{ | ||
string Text { get; } | ||
} | ||
|
||
public class ServiceA : IServiceA | ||
{ | ||
public string Text { get; set; } | ||
} | ||
} | ||
} |