From 3ce2b5ba80b377041bef7a20a2965e2cbe72cb0d Mon Sep 17 00:00:00 2001 From: dadhi Date: Sat, 29 Apr 2023 22:32:08 +0200 Subject: [PATCH] updating the targets and package versions everywhere and fixing #116 --- .vscode/launch.json | 4 +- CONTRIBUTING.md | 6 +- Directory.Build.props | 3 +- Directory.Build.targets | 4 +- appveyor.yml | 12 +- b.bat | 2 +- bt.bat | 2 +- build.bat | 21 +- build_with_packaging.bat | 11 +- docs/DryIoc.Docs/DryIoc.Docs.csproj | 14 +- playground/LoadTest/LoadTest.csproj | 4 +- playground/Playground/Playground.csproj | 8 +- .../DryIoc.CommonServiceLocator.csproj | 4 +- ...ryIoc.Microsoft.DependencyInjection.csproj | 5 +- src/DryIoc.Mvc/DryIoc.Mvc.csproj | 6 +- src/DryIoc.WebApi/DryIoc.WebApi.csproj | 2 +- src/DryIoc/DryIoc.csproj | 2 +- src/DryIocAttributes/DryIocAttributes.csproj | 3 +- ...yIoc.CommonServiceLocator.UnitTests.csproj | 2 +- .../ReducedStackoverflow.csproj | 2 +- .../DryIoc.IssuesTests.csproj | 14 +- .../GHIssue114_Resolve_Action_T.cs | 15 +- ...ators_goes_wrong_for_parallel_execution.cs | 38 ++-- .../GHIssue169_Decorators.cs | 206 ++++++++++-------- ...th_ResolveManyBehavior_AzLazyEnumerable.cs | 51 +---- ...ory_method_with_custom_constructor_args.cs | 34 ++- .../Issue572_Dynamic_Service_Keys.cs | 11 +- ...DryIoc.MefAttributedModel.UnitTests.csproj | 2 +- ...ndencyInjection.Specification.Tests.csproj | 12 +- .../DryIocAdapterSpecificationTests.cs | 4 +- .../DryIoc.Mvc.Owin.UnitTests.csproj | 2 +- .../DryIoc.Mvc.UnitTests.csproj | 4 +- .../DryIoc.SignalR.UnitTests.csproj | 2 +- .../DryIoc.TestRunner.net472.csproj | 2 +- test/DryIoc.TestRunner.net472/Program.cs | 6 + .../DryIoc.TestRunner.csproj | 4 +- test/DryIoc.TestRunner/Program.cs | 8 +- test/DryIoc.UnitTests/DryIoc.UnitTests.csproj | 2 +- .../DryIoc.Web.UnitTests.csproj | 2 +- .../DryIoc.WebApi.Owin.UnitTests.csproj | 2 +- .../DryIoc.WebApi.UnitTests.csproj | 4 +- ...oc.MefAttributedModel.UnitTests.CUT.csproj | 2 +- 42 files changed, 268 insertions(+), 276 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index af5d5bb62..b1e874d44 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -20,7 +20,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build_benchmark", - "program": "${workspaceFolder}/playground/Playground/bin/Debug/net6.0/Playground.exe", + "program": "${workspaceFolder}/playground/Playground/bin/Debug/net7.0/Playground.exe", "args": [], "cwd": "${workspaceFolder}/playground/Playground", "stopAtEntry": false, @@ -32,7 +32,7 @@ "request": "launch", "preLaunchTask": "build_testrunner", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/test/DryIoc.TestRunner/bin/Debug/net6.0/DryIoc.TestRunner.dll", + "program": "${workspaceFolder}/test/DryIoc.TestRunner/bin/Debug/net7.0/DryIoc.TestRunner.dll", "args": [], "cwd": "${workspaceFolder}/test/DryIoc.TestRunner", // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 782d193ad..f6bab8187 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,11 +54,7 @@ Make sure that there are no project build errors or failing tests. Open `DryIoc.sln` solution and re-build it. If something is failing you may try to close VS, run `b.bat` in the root folder, open VS and try to build again. -__Note:__ DryIoc targets multiple platforms (via msbuild project multi-targeting) which makes it slower to build. -To speedup the development DryIoc has `true` (TODO: Point to change) MSBuild property set to `true` in `Directory.Build.props` file in the root folder. -This setting minimizes the number of platforms to build - that's why you need to run `b.bat` to test your work for all platforms. - -__Productivity hint:__ I am using [NCrunch](http://www.ncrunch.net/) extension to build and run the tests continuously to get an immediate feedback, quickly find regressions, and generally experiment with the code. +__Productivity hint:__ I am using [NCrunch](http://www.ncrunch.net/) extension for the MS Visual Studio to build and run the tests continuously and to get the immediate feedback, quickly find regressions, and generally experiment with the code. ### Develop in Visual Studio Code diff --git a/Directory.Build.props b/Directory.Build.props index 8af55c322..1f86b0a16 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,6 @@ - true - 10 + 11 Maksim Volkau Copyright © 2013-2023 Maksim Volkau diff --git a/Directory.Build.targets b/Directory.Build.targets index 0745d3fc3..0a973e217 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,8 +1,8 @@ - - + + diff --git a/appveyor.yml b/appveyor.yml index 9e415ab03..7c619499a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ image: - Ubuntu - macOS -version: 6.0.0-preview-03-{build} +version: 6.0.0-preview-04-{build} test: off @@ -11,11 +11,11 @@ skip_commits: message: /noci .*/ build_script: - - dotnet test -f net6.0 -c:Release test/DryIoc.UnitTests/DryIoc.UnitTests.csproj - - dotnet test -f net6.0 -c:Release test/DryIoc.IssuesTests/DryIoc.IssuesTests.csproj - - dotnet test -f net6.0 -c:Release test/DryIoc.CommonServiceLocator.UnitTests/DryIoc.CommonServiceLocator.UnitTests.csproj - - dotnet test -f net6.0 -c:Release test/DryIoc.Microsoft.DependencyInjection.Specification.Tests/DryIoc.Microsoft.DependencyInjection.Specification.Tests.csproj - - dotnet test -f net6.0 -c:Release docs/DryIoc.Docs/DryIoc.Docs.csproj + - dotnet test -f net7.0 -c:Release test/DryIoc.UnitTests/DryIoc.UnitTests.csproj + - dotnet test -f net7.0 -c:Release test/DryIoc.IssuesTests/DryIoc.IssuesTests.csproj + - dotnet test -f net7.0 -c:Release test/DryIoc.CommonServiceLocator.UnitTests/DryIoc.CommonServiceLocator.UnitTests.csproj + - dotnet test -f net7.0 -c:Release test/DryIoc.Microsoft.DependencyInjection.Specification.Tests/DryIoc.Microsoft.DependencyInjection.Specification.Tests.csproj + - dotnet test -f net7.0 -c:Release docs/DryIoc.Docs/DryIoc.Docs.csproj for: - matrix: diff --git a/b.bat b/b.bat index 2daa6b4d3..804e2fb1d 100644 --- a/b.bat +++ b/b.bat @@ -2,7 +2,7 @@ setlocal EnableDelayedExpansion dotnet clean -v:m -dotnet build -c:Release -v:m -p:DevMode=false +dotnet build -c:Release -v:m if %ERRORLEVEL% neq 0 goto :error echo: diff --git a/bt.bat b/bt.bat index 595114588..ee9715916 100644 --- a/bt.bat +++ b/bt.bat @@ -2,7 +2,7 @@ setlocal EnableDelayedExpansion echo: -echo:# Build the TestRunner (.NET 6 only) +echo:# Build the TestRunner (.NET 7 only) echo: dotnet build -c Release test/DryIoc.TestRunner/DryIoc.TestRunner.csproj diff --git a/build.bat b/build.bat index 453432f6b..cddf72b74 100644 --- a/build.bat +++ b/build.bat @@ -2,26 +2,27 @@ setlocal EnableDelayedExpansion dotnet clean -v:m -dotnet build -c:Release -v:m -p:DevMode=false +dotnet build -c:Release -v:m if %ERRORLEVEL% neq 0 goto :error echo: echo:## Finished: RESTORE and BUILD echo: -@REM echo:## Starting: TestRunner... ## -@REM echo: +echo:## Starting: TestRunner... +echo: -@REM dotnet run --no-build -c Release --project test/DryIoc.TestRunner/DryIoc.TestRunner.csproj -@REM if %ERRORLEVEL% neq 0 goto :error -@REM dotnet run --no-build -c Release --project test/DryIoc.TestRunner.net472/DryIoc.TestRunner.net472.csproj +dotnet run --no-build -c Release --project test/DryIoc.TestRunner/DryIoc.TestRunner.csproj +if %ERRORLEVEL% neq 0 goto :error +dotnet run --no-build -c Release --project test/DryIoc.TestRunner.net472/DryIoc.TestRunner.net472.csproj +if %ERRORLEVEL% neq 0 goto :error -@REM if %ERRORLEVEL% neq 0 goto :error -@REM echo:## Finished: TestRunner ## -@REM echo: +echo: +echo:## Finished: TestRunner +echo: echo:## Starting: TESTS... echo: -dotnet test --no-build -c:Release -p:DevMode=false +dotnet test --no-build -c:Release if %ERRORLEVEL% neq 0 goto :error diff --git a/build_with_packaging.bat b/build_with_packaging.bat index 270df8c46..ffc60a1fc 100644 --- a/build_with_packaging.bat +++ b/build_with_packaging.bat @@ -2,26 +2,27 @@ setlocal EnableDelayedExpansion dotnet clean -v:m -dotnet build -c:Release -v:m -p:DevMode=false +dotnet build -c:Release -v:m if %ERRORLEVEL% neq 0 goto :error echo: echo:## Finished: RESTORE and BUILD echo: -echo:## Starting: TestRunner... ## +echo:## Starting: TestRunner... echo: dotnet run --no-build -c Release --project test/DryIoc.TestRunner/DryIoc.TestRunner.csproj if %ERRORLEVEL% neq 0 goto :error dotnet run --no-build -c Release --project test/DryIoc.TestRunner.net472/DryIoc.TestRunner.net472.csproj - if %ERRORLEVEL% neq 0 goto :error -echo:## Finished: TestRunner ## + +echo: +echo:## Finished: TestRunner echo: echo:## Starting: TESTS... echo: -dotnet test --no-build -c:Release -p:DevMode=false +dotnet test --no-build -c:Release if %ERRORLEVEL% neq 0 goto :error diff --git a/docs/DryIoc.Docs/DryIoc.Docs.csproj b/docs/DryIoc.Docs/DryIoc.Docs.csproj index b7d907966..2beebf662 100644 --- a/docs/DryIoc.Docs/DryIoc.Docs.csproj +++ b/docs/DryIoc.Docs/DryIoc.Docs.csproj @@ -1,7 +1,7 @@ - net6.0;net472 + net7.0;net472 false true @@ -11,14 +11,14 @@ - - - - + + + + - - + + diff --git a/playground/LoadTest/LoadTest.csproj b/playground/LoadTest/LoadTest.csproj index b29e5ac1c..89d54d615 100644 --- a/playground/LoadTest/LoadTest.csproj +++ b/playground/LoadTest/LoadTest.csproj @@ -2,7 +2,7 @@ Exe - net461 + net472 @@ -11,7 +11,7 @@ - + diff --git a/playground/Playground/Playground.csproj b/playground/Playground/Playground.csproj index 90b53eca0..cfce7b9cc 100644 --- a/playground/Playground/Playground.csproj +++ b/playground/Playground/Playground.csproj @@ -14,16 +14,16 @@ - + - + - + - + diff --git a/src/DryIoc.CommonServiceLocator/DryIoc.CommonServiceLocator.csproj b/src/DryIoc.CommonServiceLocator/DryIoc.CommonServiceLocator.csproj index 8db60ca70..ba38bc48e 100644 --- a/src/DryIoc.CommonServiceLocator/DryIoc.CommonServiceLocator.csproj +++ b/src/DryIoc.CommonServiceLocator/DryIoc.CommonServiceLocator.csproj @@ -1,6 +1,6 @@  - netstandard2.0 + netstandard2.0;net7.0 DryIoc.CommonServiceLocator 5.0.0 @@ -24,7 +24,7 @@ v5.0.0: - + diff --git a/src/DryIoc.Microsoft.DependencyInjection/DryIoc.Microsoft.DependencyInjection.csproj b/src/DryIoc.Microsoft.DependencyInjection/DryIoc.Microsoft.DependencyInjection.csproj index 9d2e5220a..ff8da1d45 100644 --- a/src/DryIoc.Microsoft.DependencyInjection/DryIoc.Microsoft.DependencyInjection.csproj +++ b/src/DryIoc.Microsoft.DependencyInjection/DryIoc.Microsoft.DependencyInjection.csproj @@ -1,10 +1,10 @@ - netstandard2.0;net6.0 + netstandard2.0;net6.0;net7.0 DryIoc.Microsoft.DependencyInjection - 7.0.0-preview-01 + 7.0.0-preview-02 $(Product) @@ -18,6 +18,7 @@ - - - + + + diff --git a/src/DryIoc.WebApi/DryIoc.WebApi.csproj b/src/DryIoc.WebApi/DryIoc.WebApi.csproj index 34db7f15b..dd6a70448 100644 --- a/src/DryIoc.WebApi/DryIoc.WebApi.csproj +++ b/src/DryIoc.WebApi/DryIoc.WebApi.csproj @@ -26,7 +26,7 @@ - + diff --git a/src/DryIoc/DryIoc.csproj b/src/DryIoc/DryIoc.csproj index fae36e913..41531c49c 100644 --- a/src/DryIoc/DryIoc.csproj +++ b/src/DryIoc/DryIoc.csproj @@ -5,7 +5,7 @@ DryIoc 6.0.0 - preview-03 + preview-04 $(Product) $(AssemblyName) $(TargetFramework) diff --git a/src/DryIocAttributes/DryIocAttributes.csproj b/src/DryIocAttributes/DryIocAttributes.csproj index ca403a021..d60ccf2dd 100644 --- a/src/DryIocAttributes/DryIocAttributes.csproj +++ b/src/DryIocAttributes/DryIocAttributes.csproj @@ -1,9 +1,10 @@ - + net45;netstandard2.0 DryIocAttributes 7.0.0 + preview-03 $(Product) diff --git a/test/DryIoc.CommonServiceLocator.UnitTests/DryIoc.CommonServiceLocator.UnitTests.csproj b/test/DryIoc.CommonServiceLocator.UnitTests/DryIoc.CommonServiceLocator.UnitTests.csproj index 7ccaa132b..6c218c9b8 100644 --- a/test/DryIoc.CommonServiceLocator.UnitTests/DryIoc.CommonServiceLocator.UnitTests.csproj +++ b/test/DryIoc.CommonServiceLocator.UnitTests/DryIoc.CommonServiceLocator.UnitTests.csproj @@ -1,6 +1,6 @@ - net6.0 + net7.0 diff --git a/test/DryIoc.Issue139_ReducedLoadTests/ReducedStackoverflow.csproj b/test/DryIoc.Issue139_ReducedLoadTests/ReducedStackoverflow.csproj index 16914a428..79824d9a3 100644 --- a/test/DryIoc.Issue139_ReducedLoadTests/ReducedStackoverflow.csproj +++ b/test/DryIoc.Issue139_ReducedLoadTests/ReducedStackoverflow.csproj @@ -16,7 +16,7 @@ - + diff --git a/test/DryIoc.IssuesTests/DryIoc.IssuesTests.csproj b/test/DryIoc.IssuesTests/DryIoc.IssuesTests.csproj index 2ae9b7f6e..3172f98e1 100644 --- a/test/DryIoc.IssuesTests/DryIoc.IssuesTests.csproj +++ b/test/DryIoc.IssuesTests/DryIoc.IssuesTests.csproj @@ -1,18 +1,16 @@ - net6.0;net472 + net7.0;net472 - - - + + - - - - + + + diff --git a/test/DryIoc.IssuesTests/GHIssue114_Resolve_Action_T.cs b/test/DryIoc.IssuesTests/GHIssue114_Resolve_Action_T.cs index caa82614f..8469b590d 100644 --- a/test/DryIoc.IssuesTests/GHIssue114_Resolve_Action_T.cs +++ b/test/DryIoc.IssuesTests/GHIssue114_Resolve_Action_T.cs @@ -1,24 +1,33 @@ using System; +using System.Collections.Generic; using System.Linq; using NUnit.Framework; namespace DryIoc.IssuesTests { [TestFixture] - public class GHIssue114_Resolve_Action_T + public class GHIssue114_Resolve_Action_T : ITest { + public int Run() + { + Test(); + return 1; + } + [Test] public void Test() { var container = new Container(); - container.RegisterInstance>(s => Console.WriteLine("1-{0}", s), IfAlreadyRegistered.AppendNotKeyed); - container.RegisterInstance>(s => Console.WriteLine("2-{0}", s), IfAlreadyRegistered.AppendNotKeyed); + var messages = new List(); + container.RegisterInstance>(s => messages.Add($"1-{s}"), IfAlreadyRegistered.AppendNotKeyed); + container.RegisterInstance>(s => messages.Add($"2-{s}"), IfAlreadyRegistered.AppendNotKeyed); var actions = container.ResolveMany>().ToList(); Assert.AreEqual(2, actions.Count); actions.ForEach(a => a.Invoke("Hello world")); + CollectionAssert.AreEquivalent(new[] { "1-Hello world", "2-Hello world" }, messages); } } } diff --git a/test/DryIoc.IssuesTests/GHIssue116_ReOpened_DryIoc_Resolve_with_decorators_goes_wrong_for_parallel_execution.cs b/test/DryIoc.IssuesTests/GHIssue116_ReOpened_DryIoc_Resolve_with_decorators_goes_wrong_for_parallel_execution.cs index 8ed3b7187..4073b28f9 100644 --- a/test/DryIoc.IssuesTests/GHIssue116_ReOpened_DryIoc_Resolve_with_decorators_goes_wrong_for_parallel_execution.cs +++ b/test/DryIoc.IssuesTests/GHIssue116_ReOpened_DryIoc_Resolve_with_decorators_goes_wrong_for_parallel_execution.cs @@ -8,7 +8,7 @@ namespace DryIoc.IssuesTests { - // [TestFixture] + [TestFixture] public class GHIssue116_ReOpened_DryIoc_Resolve_with_decorators_goes_wrong_for_parallel_execution : ITest { const int IterCount = 64; @@ -16,8 +16,8 @@ public class GHIssue116_ReOpened_DryIoc_Resolve_with_decorators_goes_wrong_for_p public int Run() { - DryIoc_Resolve_parallel_execution_on_repeat().GetAwaiter().GetResult(); - DryIoc_Resolve_parallel_execution_with_compile_service_expression_on_repeat().GetAwaiter().GetResult(); + DryIoc_Resolve_parallel_execution_on_repeat(); + DryIoc_Resolve_parallel_execution_with_compile_service_expression_on_repeat(); return 2; } @@ -29,28 +29,20 @@ class QueryDecorator : IQuery public QueryDecorator(IQuery decoratee) => Decoratee = decoratee; } - public async Task DryIoc_Resolve_parallel_execution_on_repeat() + public void DryIoc_Resolve_parallel_execution_on_repeat() { - // for single threading debugging - // using var singleThreadContext = new SingleThreadSynchronizationContext(); - // SynchronizationContext.SetSynchronizationContext(singleThreadContext); - for (var i = 0; i < IterCount; i++) - await DryIoc_Resolve_parallel_execution(i); + DryIoc_Resolve_parallel_execution(); } - public async Task DryIoc_Resolve_parallel_execution_with_compile_service_expression_on_repeat() + public void DryIoc_Resolve_parallel_execution_with_compile_service_expression_on_repeat() { - // for single threading debugging - // using var singleThreadContext = new SingleThreadSynchronizationContext(); - // SynchronizationContext.SetSynchronizationContext(singleThreadContext); - for (var i = 0; i < IterCount; i++) - await DryIoc_Resolve_parallel_execution_with_compile_service_expression(i); + DryIoc_Resolve_parallel_execution_with_compile_service_expression(); } [Test] - public async Task DryIoc_Resolve_parallel_execution(int iter) + public void DryIoc_Resolve_parallel_execution() { var container = new Container(); @@ -61,7 +53,7 @@ public async Task DryIoc_Resolve_parallel_execution(int iter) for (var i = 0; i < tasks.Length; i++) tasks[i] = Task.Run(() => container.Resolve>()); - await Task.WhenAll(tasks); + Task.WaitAll(tasks); var failed = false; var sb = new StringBuilder(tasks.Length); @@ -74,11 +66,11 @@ public async Task DryIoc_Resolve_parallel_execution(int iter) sb.Append(success ? '_' : decorator == null ? 'F' : 'f'); } - Assert.IsFalse(failed, $"Some of {tasks.Length} tasks are failed [{sb}] on iteration {iter}"); + Assert.IsFalse(failed, $"Some of {tasks.Length} tasks are failed [{sb}]"); } [Test] - public async Task DryIoc_Resolve_parallel_execution_with_compile_service_expression(int iter) + public void DryIoc_Resolve_parallel_execution_with_compile_service_expression() { var container = new Container(Rules.Default.WithoutInterpretationForTheFirstResolution()); @@ -86,13 +78,11 @@ public async Task DryIoc_Resolve_parallel_execution_with_compile_service_express container.Register(typeof(IQuery<>), typeof(Query<>)); container.Register(typeof(IQuery<>), typeof(QueryDecorator<>), setup: Setup.Decorator); - const int tasksCount = 64; - - var tasks = new Task>[tasksCount]; + var tasks = new Task>[TaskCount]; for (var i = 0; i < tasks.Length; i++) tasks[i] = Task.Run(() => container.Resolve>()); - await Task.WhenAll(tasks); + Task.WaitAll(tasks); var failed = false; var sb = new StringBuilder(tasks.Length); @@ -105,7 +95,7 @@ public async Task DryIoc_Resolve_parallel_execution_with_compile_service_express sb.Append(success ? '_' : decorator == null ? 'F' : 'f'); } - Assert.IsFalse(failed, $"Some of {tasks.Length} tasks are failed [{sb}] on iteration {iter}"); + Assert.IsFalse(failed, $"Some of {tasks.Length} tasks are failed [{sb}]"); } } diff --git a/test/DryIoc.IssuesTests/GHIssue169_Decorators.cs b/test/DryIoc.IssuesTests/GHIssue169_Decorators.cs index a5e506cd7..0f55b17ac 100644 --- a/test/DryIoc.IssuesTests/GHIssue169_Decorators.cs +++ b/test/DryIoc.IssuesTests/GHIssue169_Decorators.cs @@ -5,15 +5,24 @@ namespace DryIoc.IssuesTests { [TestFixture] - public class GHIssue169_Decorators + public class GHIssue169_Decorators : ITest { + public int Run() + { + Singleton_Decorator_should_be_correctly_resolved_in_Scoped_service_FEC(); + Singleton_Decorator_should_be_correctly_resolved_in_NamedScope_FEC(); + Transient_Decorator_should_be_correctly_resolved_in_NamedScope_FEC(); + Transient_Decorator_should_be_correctly_resolved_in_NamedScope_Interpreted(); + return 4; + } + [Test] - public void Decorator_should_be_correctly_resolved_FEC_SingletonDecorator() + public void Singleton_Decorator_should_be_correctly_resolved_in_Scoped_service_FEC() { var c = new Container(); - c.Register(Reuse.InWebRequest); - c.Register(Reuse.InWebRequest); + c.Register(Reuse.Scoped); + c.Register(Reuse.Scoped); c.RegisterMany( new List { typeof(Repo), typeof(AService), typeof(BService) }, Reuse.Singleton, @@ -21,144 +30,190 @@ public void Decorator_should_be_correctly_resolved_FEC_SingletonDecorator() ); // This is same test but Decorator is singleton - c.Register(Reuse.Singleton, setup: Setup.Decorator, - ifAlreadyRegistered: IfAlreadyRegistered.Throw); + c.Register(Reuse.Singleton, setup: Setup.Decorator); + + using (var scope = c.OpenScope()) + { + var a = scope.Resolve(); + Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); + a = scope.Resolve(); + Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); + a = scope.Resolve(); + Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); + + var b = scope.Resolve(); + Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); + b = scope.Resolve(); + Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); + b = scope.Resolve(); + Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); + } + + using (var scope = c.OpenScope()) + { + var a = scope.Resolve(); + Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); + a = scope.Resolve(); + Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); + a = scope.Resolve(); + Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); + + var b = scope.Resolve(); + Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); + b = scope.Resolve(); + Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); + b = scope.Resolve(); + Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); + } + } + + [Test] + public void Singleton_Decorator_should_be_correctly_resolved_in_NamedScope_FEC() + { + var c = new Container(); + + c.Register(Reuse.InWebRequest); + c.Register(Reuse.InWebRequest); + c.RegisterMany( + new[] { typeof(Repo), typeof(AService), typeof(BService) }, + Reuse.Singleton, + serviceTypeCondition: s => s.IsInterface + ); + + // This is same test but Decorator is singleton + c.Register(Reuse.Singleton, setup: Setup.Decorator); using (var scope = c.OpenScope(Reuse.WebRequestScopeName)) { - var a = scope.Resolve(); + var a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - a = scope.Resolve(); + a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - a = scope.Resolve(); + a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - var b = scope.Resolve(); + var b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); - b = scope.Resolve(); + b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); - b = scope.Resolve(); + b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); } using (var scope = c.OpenScope(Reuse.WebRequestScopeName)) { - var a = scope.Resolve(); + var a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - a = scope.Resolve(); + a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - a = scope.Resolve(); + a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - var b = scope.Resolve(); + var b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); - b = scope.Resolve(); + b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); - b = scope.Resolve(); + b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); } } [Test] - public void Decorator_should_be_correctly_resolved_FEC() + public void Transient_Decorator_should_be_correctly_resolved_in_NamedScope_FEC() { var c = new Container(); - c.Register(Reuse.InWebRequest); - c.Register(Reuse.InWebRequest); + c.Register(Reuse.InWebRequest); + c.Register(Reuse.InWebRequest); c.RegisterMany( - new List {typeof(Repo), typeof(AService), typeof(BService)}, + new List { typeof(Repo), typeof(AService), typeof(BService) }, Reuse.Singleton, serviceTypeCondition: s => s.IsInterface ); - c.Register(setup: Setup.Decorator, - ifAlreadyRegistered: IfAlreadyRegistered.Throw); - + c.Register(setup: Setup.Decorator); using (var scope = c.OpenScope(Reuse.WebRequestScopeName)) { - var a = scope.Resolve(); + var a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - a = scope.Resolve(); + a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - a = scope.Resolve(); + a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - var b = scope.Resolve(); + var b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); - b = scope.Resolve(); + b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); - b = scope.Resolve(); + b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); } using (var scope = c.OpenScope(Reuse.WebRequestScopeName)) { - var a = scope.Resolve(); + var a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - a = scope.Resolve(); + a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - a = scope.Resolve(); + a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - var b = scope.Resolve(); + var b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); - b = scope.Resolve(); + b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); - b = scope.Resolve(); + b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); } } [Test] - public void Decorator_should_be_correctly_resolved_Interpret() + public void Transient_Decorator_should_be_correctly_resolved_in_NamedScope_Interpreted() { var c = new Container(rules => rules.WithUseInterpretation()); - c.Register(Reuse.InWebRequest); - c.Register(Reuse.InWebRequest); + c.Register(Reuse.InWebRequest); + c.Register(Reuse.InWebRequest); c.RegisterMany( - new List {typeof(Repo), typeof(AService), typeof(BService)}, + new List { typeof(Repo), typeof(AService), typeof(BService) }, Reuse.Singleton, serviceTypeCondition: s => s.IsInterface ); - c.Register(setup: Setup.Decorator, - ifAlreadyRegistered: IfAlreadyRegistered.Throw); - + c.Register(setup: Setup.Decorator); using (var scope = c.OpenScope(Reuse.WebRequestScopeName)) { - var a = scope.Resolve(); + var a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - a = scope.Resolve(); + a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - a = scope.Resolve(); + a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - var b = scope.Resolve(); + var b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); - b = scope.Resolve(); + b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); - b = scope.Resolve(); + b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); } using (var scope = c.OpenScope(Reuse.WebRequestScopeName)) { - var a = scope.Resolve(); + var a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - a = scope.Resolve(); + a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - a = scope.Resolve(); + a = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__A_Controller", a.Identify()); - var b = scope.Resolve(); + var b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); - b = scope.Resolve(); + b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); - b = scope.Resolve(); + b = scope.Resolve(); Assert.AreEqual("REPO_DECORATOR__B_Controller2", b.Identify()); } } @@ -176,12 +231,7 @@ public class Repo : IRepository public class RepoDecorator : IRepository { protected readonly IRepository repo; - - public RepoDecorator(IRepository repo) - { - this.repo = repo; - } - + public RepoDecorator(IRepository repo) => this.repo = repo; public string Identify() => repo.Identify() + "_DECORATOR_"; } @@ -198,48 +248,28 @@ public interface IBService public class AService : IAService { private readonly IRepository repo; - - public AService(IRepository repo) - { - this.repo = repo; - } - + public AService(IRepository repo) => this.repo = repo; public string Identify() => repo.Identify() + "_A_"; } public class BService : IBService { private readonly IRepository repo; - - public BService(IRepository repo) - { - this.repo = repo; - } - + public BService(IRepository repo) => this.repo = repo; public string Identify() => repo.Identify() + "_B_"; } - public class Controller2 + public class ControllerB { private readonly IBService service; - - public Controller2(IBService service) - { - this.service = service; - } - + public ControllerB(IBService service) => this.service = service; public string Identify() => service.Identify() + "Controller2"; } - public class Controller + public class ControllerA { private readonly IAService service; - - public Controller(IAService service) - { - this.service = service; - } - + public ControllerA(IAService service) => this.service = service; public string Identify() => service.Identify() + "Controller"; } } diff --git a/test/DryIoc.IssuesTests/GHIssue32_Memory_leak_with_ResolveManyBehavior_AzLazyEnumerable.cs b/test/DryIoc.IssuesTests/GHIssue32_Memory_leak_with_ResolveManyBehavior_AzLazyEnumerable.cs index 6860d7883..f6810f8c0 100644 --- a/test/DryIoc.IssuesTests/GHIssue32_Memory_leak_with_ResolveManyBehavior_AzLazyEnumerable.cs +++ b/test/DryIoc.IssuesTests/GHIssue32_Memory_leak_with_ResolveManyBehavior_AzLazyEnumerable.cs @@ -1,8 +1,5 @@ -using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; -using JetBrains.dotMemoryUnit; using NUnit.Framework; namespace DryIoc.IssuesTests @@ -13,8 +10,8 @@ public class GHIssue32_Memory_leak_with_ResolveManyBehavior_AzLazyEnumerable : I public int Run() { Test(); - // Test_memory_allocations(); - return 1; + Test_memory_allocations(); + return 2; } [Test] @@ -33,10 +30,6 @@ public void Test() Assert.AreEqual(2, interceptors2.Count); } - [Conditional("DEBUG")] - void Print(object x) => Console.WriteLine(x); - - [DotMemoryUnit(CollectAllocations = true, FailIfRunWithoutSupport = false)] [Test] public void Test_memory_allocations() { @@ -44,53 +37,13 @@ public void Test_memory_allocations() c.Register(typeof(IIncomingRequestInterceptor<>), typeof(FooInterceptor<>)); c.Register(typeof(IIncomingRequestInterceptor<>), typeof(BarInterceptor<>)); - var memoryCheckPoint = dotMemory.Check(); - var interceptorType = typeof(IIncomingRequestInterceptor<>).MakeGenericType(typeof(int)); var interceptors1 = c.ResolveMany(interceptorType).ToList(); var interceptors2 = c.ResolveMany(interceptorType).ToList(); - - dotMemory.Check(memory => - Assert.That(memory.GetDifference(memoryCheckPoint) - .GetNewObjects(where => where.Type.Like("DryIoc.FactoryDelegate")).ObjectsCount, Is.EqualTo(2))); - - dotMemory.Check(memory => - { - Print("## Check 1"); - - var newObjects = memory.GetDifference(memoryCheckPoint) - .GetNewObjects(x => x.Namespace.Like("DryIoc")) - .GroupByType(); - - foreach (var info in newObjects) - Print(info); - Print(""); - }); - - var memoryCheckPoint2 = dotMemory.Check(); - var interceptors3 = c.ResolveMany(interceptorType).ToList(); var interceptors4 = c.ResolveMany(interceptorType).ToList(); - // no new factory delegates should be created, everything is taken from cache - dotMemory.Check(memory => - Assert.That(memory.GetDifference(memoryCheckPoint2) - .GetNewObjects(where => where.Type.Like("DryIoc.FactoryDelegate")).ObjectsCount, Is.EqualTo(0))); - - dotMemory.Check(memory => - { - Print("## Check 2"); - - var newObjects = memory.GetDifference(memoryCheckPoint2) - .GetNewObjects(x => x.Namespace.Like("DryIoc")) - .GroupByType(); - - foreach (var info in newObjects) - Print(info); - Print(""); - }); - // store into field to prevent collection Interceptors = new List { interceptors1, interceptors2, interceptors3, interceptors4 }; } diff --git a/test/DryIoc.IssuesTests/GHIssue461_Transient_IDisposable_factory_method_with_custom_constructor_args.cs b/test/DryIoc.IssuesTests/GHIssue461_Transient_IDisposable_factory_method_with_custom_constructor_args.cs index bfa9fb560..05e52f26b 100644 --- a/test/DryIoc.IssuesTests/GHIssue461_Transient_IDisposable_factory_method_with_custom_constructor_args.cs +++ b/test/DryIoc.IssuesTests/GHIssue461_Transient_IDisposable_factory_method_with_custom_constructor_args.cs @@ -1,9 +1,6 @@ using System; using NUnit.Framework; -#nullable enable -using JetBrains.Lifetimes; - namespace DryIoc.IssuesTests { [TestFixture] @@ -22,8 +19,7 @@ public void Test() // Resolver should receive type name of original requester c.Register( - made: Parameters.Of.Type(r => - r.Parent.Parent.ImplementationType.Name), + made: Parameters.Of.Type(r => r.Parent.Parent.ImplementationType.Name), setup: Setup.With(trackDisposableTransient: true)); c.Register(Reuse.Scoped, @@ -47,25 +43,25 @@ public void Test() public class LifetimeResolver : IDisposable { - private string? _id; - private LifetimeDefinition? _def; - - public LifetimeResolver(string? id) - { - _id = id; - } + private string _id; + public LifetimeResolver(string id) => _id = id; + private Lifetime _lifetime; public Lifetime GetValue() { - if (_def is null) - { - _def = Lifetime.Define(Lifetime.Eternal, _id, (Action?)default); - } - - return _def.Lifetime; + if (_lifetime is null) + _lifetime = new Lifetime(_id); + return _lifetime; } - public void Dispose() => _def?.Terminate(); + public void Dispose() => _lifetime?.Terminate(); + } + + public class Lifetime + { + public string Id; + public Lifetime(string id) => Id = id; + internal void Terminate() {} } public abstract class L diff --git a/test/DryIoc.IssuesTests/Issue572_Dynamic_Service_Keys.cs b/test/DryIoc.IssuesTests/Issue572_Dynamic_Service_Keys.cs index 18a2b2cfd..ec0461a03 100644 --- a/test/DryIoc.IssuesTests/Issue572_Dynamic_Service_Keys.cs +++ b/test/DryIoc.IssuesTests/Issue572_Dynamic_Service_Keys.cs @@ -1,13 +1,18 @@ using System.Collections.Generic; using System.Linq; -using Castle.Core.Internal; using NUnit.Framework; namespace DryIoc.IssuesTests { [TestFixture] - public class Issue572_Dynamic_Service_Keys + public class Issue572_Dynamic_Service_Keys : ITest { + public int Run() + { + Can_provide_argument_both_with_the_factory_and_via_Resolve(); + return 1; + } + [Test] public void Can_provide_argument_both_with_the_factory_and_via_Resolve() { @@ -30,7 +35,7 @@ public void Can_provide_argument_both_with_the_factory_and_via_Resolve() public static ISomeServiceClient CreateClient(DataStore dataStore, string forceToken = null) { - if (!forceToken.IsNullOrEmpty()) + if (!string.IsNullOrEmpty(forceToken)) return new MyClient(forceToken); var defaultClient = dataStore.Accounts.First(a => a.IsDefault); return new MyClient(defaultClient.Token); diff --git a/test/DryIoc.MefAttributedModel.UnitTests/DryIoc.MefAttributedModel.UnitTests.csproj b/test/DryIoc.MefAttributedModel.UnitTests/DryIoc.MefAttributedModel.UnitTests.csproj index 84d24280f..c361f7e3f 100644 --- a/test/DryIoc.MefAttributedModel.UnitTests/DryIoc.MefAttributedModel.UnitTests.csproj +++ b/test/DryIoc.MefAttributedModel.UnitTests/DryIoc.MefAttributedModel.UnitTests.csproj @@ -1,6 +1,6 @@  - net6.0;net45 + net7.0;net472 diff --git a/test/DryIoc.Microsoft.DependencyInjection.Specification.Tests/DryIoc.Microsoft.DependencyInjection.Specification.Tests.csproj b/test/DryIoc.Microsoft.DependencyInjection.Specification.Tests/DryIoc.Microsoft.DependencyInjection.Specification.Tests.csproj index 56f92b943..0522ecd0f 100644 --- a/test/DryIoc.Microsoft.DependencyInjection.Specification.Tests/DryIoc.Microsoft.DependencyInjection.Specification.Tests.csproj +++ b/test/DryIoc.Microsoft.DependencyInjection.Specification.Tests/DryIoc.Microsoft.DependencyInjection.Specification.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net6.0;net7.0 @@ -9,14 +9,14 @@ - + all runtime; build; native; contentfiles; analyzers - - - - + + + + diff --git a/test/DryIoc.Microsoft.DependencyInjection.Specification.Tests/DryIocAdapterSpecificationTests.cs b/test/DryIoc.Microsoft.DependencyInjection.Specification.Tests/DryIocAdapterSpecificationTests.cs index 858b930e9..86208adc2 100644 --- a/test/DryIoc.Microsoft.DependencyInjection.Specification.Tests/DryIocAdapterSpecificationTests.cs +++ b/test/DryIoc.Microsoft.DependencyInjection.Specification.Tests/DryIocAdapterSpecificationTests.cs @@ -95,7 +95,7 @@ public void OpenGenericsWithIsService_DoubleTest() } [Test] - public void ServiceScopeFactoryIsSingleton() + public void ServiceScopeFactoryIsSingleton_local() { // Arrange var collection = new TestServiceCollection(); @@ -115,7 +115,7 @@ public void ServiceScopeFactoryIsSingleton() } [Test] - public void ScopesAreFlatNotHierarchical() + public void ScopesAreFlatNotHierarchical_local() { // Arrange var collection = new TestServiceCollection(); diff --git a/test/DryIoc.Mvc.Owin.UnitTests/DryIoc.Mvc.Owin.UnitTests.csproj b/test/DryIoc.Mvc.Owin.UnitTests/DryIoc.Mvc.Owin.UnitTests.csproj index 8e22af469..d94fdbaa1 100644 --- a/test/DryIoc.Mvc.Owin.UnitTests/DryIoc.Mvc.Owin.UnitTests.csproj +++ b/test/DryIoc.Mvc.Owin.UnitTests/DryIoc.Mvc.Owin.UnitTests.csproj @@ -1,6 +1,6 @@  - net45 + net472 diff --git a/test/DryIoc.Mvc.UnitTests/DryIoc.Mvc.UnitTests.csproj b/test/DryIoc.Mvc.UnitTests/DryIoc.Mvc.UnitTests.csproj index 9cf97c8a4..ec7f7bfb5 100644 --- a/test/DryIoc.Mvc.UnitTests/DryIoc.Mvc.UnitTests.csproj +++ b/test/DryIoc.Mvc.UnitTests/DryIoc.Mvc.UnitTests.csproj @@ -1,6 +1,6 @@  - net45 + net472 @@ -8,7 +8,7 @@ - + diff --git a/test/DryIoc.SignalR.UnitTests/DryIoc.SignalR.UnitTests.csproj b/test/DryIoc.SignalR.UnitTests/DryIoc.SignalR.UnitTests.csproj index 7eeccfda1..e27be8151 100644 --- a/test/DryIoc.SignalR.UnitTests/DryIoc.SignalR.UnitTests.csproj +++ b/test/DryIoc.SignalR.UnitTests/DryIoc.SignalR.UnitTests.csproj @@ -1,6 +1,6 @@  - net45 + net472 diff --git a/test/DryIoc.TestRunner.net472/DryIoc.TestRunner.net472.csproj b/test/DryIoc.TestRunner.net472/DryIoc.TestRunner.net472.csproj index bb66a0fea..16da111e9 100644 --- a/test/DryIoc.TestRunner.net472/DryIoc.TestRunner.net472.csproj +++ b/test/DryIoc.TestRunner.net472/DryIoc.TestRunner.net472.csproj @@ -15,7 +15,7 @@ - + diff --git a/test/DryIoc.TestRunner.net472/Program.cs b/test/DryIoc.TestRunner.net472/Program.cs index 16ea4d6d4..e8ede2031 100644 --- a/test/DryIoc.TestRunner.net472/Program.cs +++ b/test/DryIoc.TestRunner.net472/Program.cs @@ -81,6 +81,9 @@ public static void RunAllTests() new Issue152_ExponentialMemoryPerformanceWithRegardsToTheObjectGraphSize(), new Issue497_ConstructorWithResolvableArguments_is_not_working_properly(), new Issue548_After_registering_a_factory_Func_is_returned_instead_of_the_result_of_Func(), + new Issue572_Dynamic_Service_Keys(), + + new Messages_Test(), new GHIssue4_Rule_for_Func_and_Lazy_to_be_resolved_even_without_requested_service_registered(), new GHIssue6_Open_generic_singleton_service_registration_that_satisfies_multiple_interfaces(), new GHIssue7_1_Context_based_injection(), @@ -88,7 +91,10 @@ public static void RunAllTests() new GHIssue29_Resolve_caches_args_values(), new GHIssue32_Memory_leak_with_ResolveManyBehavior_AzLazyEnumerable(), new GHIssue80_ScopedOrSingleton_extra_constructor_calls(), + new GHIssue114_Resolve_Action_T(), new GHIssue116_DryIoc_Resolve_with_decorators_goes_wrong_for_parallel_execution(), + new GHIssue116_ReOpened_DryIoc_Resolve_with_decorators_goes_wrong_for_parallel_execution(), + new GHIssue169_Decorators(), new GHIssue180_Option_nullable_int_argument_with_not_null_default_value(), new GHIssue191_Optional_IResolverContext_argument_in_Func_of_service(), new GHIssue198_Open_generics_resolve_fails_if_there_is_a_static_constructor(), diff --git a/test/DryIoc.TestRunner/DryIoc.TestRunner.csproj b/test/DryIoc.TestRunner/DryIoc.TestRunner.csproj index 8e2ad1f2c..35b893b8f 100644 --- a/test/DryIoc.TestRunner/DryIoc.TestRunner.csproj +++ b/test/DryIoc.TestRunner/DryIoc.TestRunner.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net7.0 false true @@ -14,7 +14,7 @@ - + diff --git a/test/DryIoc.TestRunner/Program.cs b/test/DryIoc.TestRunner/Program.cs index cb4f4545c..5a4d8ddcf 100644 --- a/test/DryIoc.TestRunner/Program.cs +++ b/test/DryIoc.TestRunner/Program.cs @@ -11,6 +11,8 @@ public static void Main() { RunAllTests(); + // new GHIssue169_Decorators().Run(); + // new ActionTests().Run(); // new GHIssue116_ReOpened_DryIoc_Resolve_with_decorators_goes_wrong_for_parallel_execution().Run(); // new GHIssue116_DryIoc_Resolve_with_decorators_goes_wrong_for_parallel_execution().Run(); @@ -98,7 +100,9 @@ public static void RunAllTests() new Issue446_Select_single_open_generic_impl_based_on_matching_closed_service_type(), new Issue497_ConstructorWithResolvableArguments_is_not_working_properly(), new Issue548_After_registering_a_factory_Func_is_returned_instead_of_the_result_of_Func(), + new Issue572_Dynamic_Service_Keys(), + new Messages_Test(), new GHIssue4_Rule_for_Func_and_Lazy_to_be_resolved_even_without_requested_service_registered(), new GHIssue6_Open_generic_singleton_service_registration_that_satisfies_multiple_interfaces(), new GHIssue7_1_Context_based_injection(), @@ -106,10 +110,12 @@ public static void RunAllTests() new GHIssue29_Resolve_caches_args_values(), new GHIssue32_Memory_leak_with_ResolveManyBehavior_AzLazyEnumerable(), new GHIssue37_MediatR_Polymorphic_Notification(), - new Messages_Test(), new GHIssue80_ScopedOrSingleton_extra_constructor_calls(), new GHIssue101_Compile_time_generated_object_graph(), + new GHIssue114_Resolve_Action_T(), new GHIssue116_DryIoc_Resolve_with_decorators_goes_wrong_for_parallel_execution(), + new GHIssue116_ReOpened_DryIoc_Resolve_with_decorators_goes_wrong_for_parallel_execution(), + new GHIssue169_Decorators(), new GHIssue180_Option_nullable_int_argument_with_not_null_default_value(), new GHIssue191_Optional_IResolverContext_argument_in_Func_of_service(), new GHIssue198_Open_generics_resolve_fails_if_there_is_a_static_constructor(), diff --git a/test/DryIoc.UnitTests/DryIoc.UnitTests.csproj b/test/DryIoc.UnitTests/DryIoc.UnitTests.csproj index 3dca7c504..8ac3f2beb 100644 --- a/test/DryIoc.UnitTests/DryIoc.UnitTests.csproj +++ b/test/DryIoc.UnitTests/DryIoc.UnitTests.csproj @@ -1,7 +1,7 @@  - net6.0;net472 + net7.0;net472 diff --git a/test/DryIoc.Web.UnitTests/DryIoc.Web.UnitTests.csproj b/test/DryIoc.Web.UnitTests/DryIoc.Web.UnitTests.csproj index 3a739626d..5d7fcd13f 100644 --- a/test/DryIoc.Web.UnitTests/DryIoc.Web.UnitTests.csproj +++ b/test/DryIoc.Web.UnitTests/DryIoc.Web.UnitTests.csproj @@ -1,6 +1,6 @@  - net45 + net472 diff --git a/test/DryIoc.WebApi.Owin.UnitTests/DryIoc.WebApi.Owin.UnitTests.csproj b/test/DryIoc.WebApi.Owin.UnitTests/DryIoc.WebApi.Owin.UnitTests.csproj index d01371e9a..bdbad2654 100644 --- a/test/DryIoc.WebApi.Owin.UnitTests/DryIoc.WebApi.Owin.UnitTests.csproj +++ b/test/DryIoc.WebApi.Owin.UnitTests/DryIoc.WebApi.Owin.UnitTests.csproj @@ -1,7 +1,7 @@  - net45 + net472 diff --git a/test/DryIoc.WebApi.UnitTests/DryIoc.WebApi.UnitTests.csproj b/test/DryIoc.WebApi.UnitTests/DryIoc.WebApi.UnitTests.csproj index fd46f5df2..51f3152de 100644 --- a/test/DryIoc.WebApi.UnitTests/DryIoc.WebApi.UnitTests.csproj +++ b/test/DryIoc.WebApi.UnitTests/DryIoc.WebApi.UnitTests.csproj @@ -1,9 +1,9 @@  - net45 + net472 - + diff --git a/test_sut/DryIoc.MefAttributedModel.UnitTests.CUT/DryIoc.MefAttributedModel.UnitTests.CUT.csproj b/test_sut/DryIoc.MefAttributedModel.UnitTests.CUT/DryIoc.MefAttributedModel.UnitTests.CUT.csproj index 7eb46be81..d9c3e56b6 100644 --- a/test_sut/DryIoc.MefAttributedModel.UnitTests.CUT/DryIoc.MefAttributedModel.UnitTests.CUT.csproj +++ b/test_sut/DryIoc.MefAttributedModel.UnitTests.CUT/DryIoc.MefAttributedModel.UnitTests.CUT.csproj @@ -1,7 +1,7 @@ - net6.0;net45 + net7.0;net472 false