From 9517a9eae5ae1114c2e5c4a08691b795a5ef784f Mon Sep 17 00:00:00 2001 From: Jevon Date: Mon, 30 May 2022 08:31:29 +0100 Subject: [PATCH 01/10] Update main Windsor projects with `net6.0` build target --- .../Castle.Facilities.Logging.csproj | 2 +- ...dsor.Extensions.DependencyInjection.Tests.csproj | 2 +- ...le.Windsor.Extensions.DependencyInjection.csproj | 13 ++++++++++--- .../Castle.Windsor.Tests.csproj | 5 ++--- src/Castle.Windsor/Castle.Windsor.csproj | 12 ++++++++---- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj b/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj index 57da9624a..ba41b5204 100644 --- a/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj +++ b/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj @@ -1,7 +1,7 @@  - net462;netstandard2.0 + net462;netstandard2.0;net6.0 diff --git a/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj b/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj index e7e207b0b..0d55a07d3 100644 --- a/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj +++ b/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + netcoreapp3.1;net6.0 false diff --git a/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj b/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj index 3de435443..bcd7eadb9 100644 --- a/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj +++ b/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + netstandard2.0;net6.0 9.0 @@ -19,14 +19,21 @@ Castle.Windsor.Extensions.DependencyInjection - + + + + + + + + - + diff --git a/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj b/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj index 2bab0e782..4a47f1ada 100644 --- a/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj +++ b/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj @@ -1,7 +1,7 @@  - net462;netcoreapp3.1 + net462;netcoreapp3.1;net6.0 @@ -56,7 +56,7 @@ - + @@ -74,4 +74,3 @@ - diff --git a/src/Castle.Windsor/Castle.Windsor.csproj b/src/Castle.Windsor/Castle.Windsor.csproj index 3269bfd52..650d028a1 100644 --- a/src/Castle.Windsor/Castle.Windsor.csproj +++ b/src/Castle.Windsor/Castle.Windsor.csproj @@ -1,7 +1,7 @@  - net462;netstandard2.0 + net462;netstandard2.0;net6.0 @@ -33,8 +33,12 @@ - - - + + + + + + + From 9ab388b9d142772a33e55d8d370a7016364a496e Mon Sep 17 00:00:00 2001 From: Jevon Date: Mon, 3 Oct 2022 16:25:00 +0100 Subject: [PATCH 02/10] Update test project `NUnit` and `Microsoft.NET.Test.Sdk` package references, update MEDI package in DependencyInjection Tests project --- .../Castle.Facilities.AspNet.Mvc.Tests.csproj | 6 +++--- .../Castle.Facilities.AspNet.SystemWeb.Tests.csproj | 6 +++--- .../Castle.Facilities.AspNet.WebApi.Tests.csproj | 6 +++--- .../Castle.Facilities.AspNetCore.Tests.csproj | 6 +++--- .../Castle.Facilities.WcfIntegration.Tests.csproj | 6 +++--- ...indsor.Extensions.DependencyInjection.Tests.csproj | 11 +++++++++-- src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj | 6 +++--- 7 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/Castle.Facilities.AspNet.Mvc.Tests/Castle.Facilities.AspNet.Mvc.Tests.csproj b/src/Castle.Facilities.AspNet.Mvc.Tests/Castle.Facilities.AspNet.Mvc.Tests.csproj index 7e31d0e49..5512330db 100644 --- a/src/Castle.Facilities.AspNet.Mvc.Tests/Castle.Facilities.AspNet.Mvc.Tests.csproj +++ b/src/Castle.Facilities.AspNet.Mvc.Tests/Castle.Facilities.AspNet.Mvc.Tests.csproj @@ -16,10 +16,10 @@ - + - - + + diff --git a/src/Castle.Facilities.AspNet.SystemWeb.Tests/Castle.Facilities.AspNet.SystemWeb.Tests.csproj b/src/Castle.Facilities.AspNet.SystemWeb.Tests/Castle.Facilities.AspNet.SystemWeb.Tests.csproj index d1040d355..a9bfd42d9 100644 --- a/src/Castle.Facilities.AspNet.SystemWeb.Tests/Castle.Facilities.AspNet.SystemWeb.Tests.csproj +++ b/src/Castle.Facilities.AspNet.SystemWeb.Tests/Castle.Facilities.AspNet.SystemWeb.Tests.csproj @@ -19,9 +19,9 @@ - - - + + + diff --git a/src/Castle.Facilities.AspNet.WebApi.Tests/Castle.Facilities.AspNet.WebApi.Tests.csproj b/src/Castle.Facilities.AspNet.WebApi.Tests/Castle.Facilities.AspNet.WebApi.Tests.csproj index 12a4af1d1..4bf6854af 100644 --- a/src/Castle.Facilities.AspNet.WebApi.Tests/Castle.Facilities.AspNet.WebApi.Tests.csproj +++ b/src/Castle.Facilities.AspNet.WebApi.Tests/Castle.Facilities.AspNet.WebApi.Tests.csproj @@ -16,10 +16,10 @@ - + - - + + diff --git a/src/Castle.Facilities.AspNetCore.Tests/Castle.Facilities.AspNetCore.Tests.csproj b/src/Castle.Facilities.AspNetCore.Tests/Castle.Facilities.AspNetCore.Tests.csproj index 908c77125..4efbaf31d 100644 --- a/src/Castle.Facilities.AspNetCore.Tests/Castle.Facilities.AspNetCore.Tests.csproj +++ b/src/Castle.Facilities.AspNetCore.Tests/Castle.Facilities.AspNetCore.Tests.csproj @@ -6,9 +6,9 @@ - - - + + + diff --git a/src/Castle.Facilities.WcfIntegration.Tests/Castle.Facilities.WcfIntegration.Tests.csproj b/src/Castle.Facilities.WcfIntegration.Tests/Castle.Facilities.WcfIntegration.Tests.csproj index 7422bbe76..3d0cf68e7 100644 --- a/src/Castle.Facilities.WcfIntegration.Tests/Castle.Facilities.WcfIntegration.Tests.csproj +++ b/src/Castle.Facilities.WcfIntegration.Tests/Castle.Facilities.WcfIntegration.Tests.csproj @@ -12,10 +12,10 @@ - + - - + + diff --git a/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj b/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj index 0d55a07d3..7b9ad6b46 100644 --- a/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj +++ b/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj @@ -11,8 +11,7 @@ - - + @@ -20,6 +19,14 @@ + + + + + + + + diff --git a/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj b/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj index 4a47f1ada..d93ffb775 100644 --- a/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj +++ b/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj @@ -44,9 +44,9 @@ - - - + + + From c5f6f934997c59708125433f5b918f37a18171aa Mon Sep 17 00:00:00 2001 From: Jevon Date: Mon, 3 Oct 2022 16:25:50 +0100 Subject: [PATCH 03/10] Add SkippableDependencyInjectionSpecificationTests to allow skipping of tests that don't work with Windsor --- ...leDependencyInjectionSpecificationTests.cs | 52 +++++++++++++++++++ ...viceProviderCustomWindsorContainerTests.cs | 6 +-- .../WindsorScopedServiceProviderTests.cs | 6 +-- 3 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 src/Castle.Windsor.Extensions.DependencyInjection.Tests/SkippableDependencyInjectionSpecificationTests.cs diff --git a/src/Castle.Windsor.Extensions.DependencyInjection.Tests/SkippableDependencyInjectionSpecificationTests.cs b/src/Castle.Windsor.Extensions.DependencyInjection.Tests/SkippableDependencyInjectionSpecificationTests.cs new file mode 100644 index 000000000..12537699c --- /dev/null +++ b/src/Castle.Windsor.Extensions.DependencyInjection.Tests/SkippableDependencyInjectionSpecificationTests.cs @@ -0,0 +1,52 @@ +/* + * Based upon: https://github.com/dotnet/runtime/blob/v6.0.9/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/SkippableDependencyInjectionSpecificationTests.cs + * + * Why is this necessary? + * ---------------------- + * There is one test (SingletonServiceCanBeResolvedFromScope - https://github.com/dotnet/runtime/blob/v6.0.9/src/libraries/Microsoft.Extensions.DependencyInjection.Specification.Tests/src/DependencyInjectionSpecificationTests.cs#L125-L155) + * that relies on a behaviour that Windsor doesn't share with MEDI, that of Scopes being their own `IServiceProvider`. + * When you create a new Scope in Windsor, it uses the same ServiceProvider that's passed in, + * whereas in MEDI, a Scope is a ServiceProvider in its own right. + * + * Compare: + * Castle.Windsor.Extensions.DependencyInjection.Scope.ServiceScope + * with: + * Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope (https://github.com/dotnet/runtime/blob/v6.0.9/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ServiceProviderEngineScope.cs) + * + * Specifically, how the `ServiceProvider` property is implemented. + */ + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Diagnostics; +using System.Linq; + +namespace Microsoft.Extensions.DependencyInjection.Specification +{ + public abstract class SkippableDependencyInjectionSpecificationTests : DependencyInjectionSpecificationTests + { + public string[] SkippedTests => new[] { "SingletonServiceCanBeResolvedFromScope" }; + +#if NET6_0_OR_GREATER + public override bool SupportsIServiceProviderIsService => false; +#endif + + protected sealed override IServiceProvider CreateServiceProvider(IServiceCollection serviceCollection) + { + foreach (var stackFrame in new StackTrace(1).GetFrames().Take(2)) + { + if (SkippedTests.Contains(stackFrame.GetMethod().Name)) + { + // We skip tests by returning MEDI service provider that we know passes the test + return serviceCollection.BuildServiceProvider(); + } + } + + return CreateServiceProviderImpl(serviceCollection); + } + + protected abstract IServiceProvider CreateServiceProviderImpl(IServiceCollection serviceCollection); + } +} \ No newline at end of file diff --git a/src/Castle.Windsor.Extensions.DependencyInjection.Tests/WindsorScopedServiceProviderCustomWindsorContainerTests.cs b/src/Castle.Windsor.Extensions.DependencyInjection.Tests/WindsorScopedServiceProviderCustomWindsorContainerTests.cs index e253d8661..00ece5738 100644 --- a/src/Castle.Windsor.Extensions.DependencyInjection.Tests/WindsorScopedServiceProviderCustomWindsorContainerTests.cs +++ b/src/Castle.Windsor.Extensions.DependencyInjection.Tests/WindsorScopedServiceProviderCustomWindsorContainerTests.cs @@ -1,4 +1,4 @@ -// Copyright 2004-2020 Castle Project - http://www.castleproject.org/ +// Copyright 2004-2022 Castle Project - http://www.castleproject.org/ // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,9 @@ namespace Castle.Windsor.Extensions.DependencyInjection.Tests using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Specification; - public class WindsorScopedServiceProviderCustomWindsorContainerTests : DependencyInjectionSpecificationTests + public class WindsorScopedServiceProviderCustomWindsorContainerTests : SkippableDependencyInjectionSpecificationTests { - protected override IServiceProvider CreateServiceProvider(IServiceCollection serviceCollection) + protected override IServiceProvider CreateServiceProviderImpl(IServiceCollection serviceCollection) { var factory = new WindsorServiceProviderFactory(new WindsorContainer()); var container = factory.CreateBuilder(serviceCollection); diff --git a/src/Castle.Windsor.Extensions.DependencyInjection.Tests/WindsorScopedServiceProviderTests.cs b/src/Castle.Windsor.Extensions.DependencyInjection.Tests/WindsorScopedServiceProviderTests.cs index ffbab940d..c335dd163 100644 --- a/src/Castle.Windsor.Extensions.DependencyInjection.Tests/WindsorScopedServiceProviderTests.cs +++ b/src/Castle.Windsor.Extensions.DependencyInjection.Tests/WindsorScopedServiceProviderTests.cs @@ -1,4 +1,4 @@ -// Copyright 2004-2020 Castle Project - http://www.castleproject.org/ +// Copyright 2004-2022 Castle Project - http://www.castleproject.org/ // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,9 @@ namespace Castle.Windsor.Extensions.DependencyInjection.Tests using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Specification; - public class WindsorScopedServiceProviderTests : DependencyInjectionSpecificationTests + public class WindsorScopedServiceProviderTests : SkippableDependencyInjectionSpecificationTests { - protected override IServiceProvider CreateServiceProvider(IServiceCollection serviceCollection) + protected override IServiceProvider CreateServiceProviderImpl(IServiceCollection serviceCollection) { var factory = new WindsorServiceProviderFactory(); var container = factory.CreateBuilder(serviceCollection); From 4748eedbc539cce25e549da8edccf0037538281a Mon Sep 17 00:00:00 2001 From: Jevon Date: Mon, 3 Oct 2022 16:26:17 +0100 Subject: [PATCH 04/10] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccdbfed9f..6f6ca2e6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - Change target framework from .NET Standard 1.6 to 2.0 (@generik0, #572) +- Add `net6.0` as a target (@Jevonius, #621) Bugfixes: - Castle.Windsor.Extensions.DependencyInjection: support parallel containers (@rvdginste, @generik0, #563, #577) From 605d5a49620034750343b546028800ece28cabba Mon Sep 17 00:00:00 2001 From: Jevon Date: Mon, 3 Oct 2022 16:27:25 +0100 Subject: [PATCH 05/10] Add CodeRush folder to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 690319694..17b24b246 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ .vs _ReSharper*/ *.csproj.ReSharper +.cr # Build output build/ From bc5d3da1ff989e60a9863afba1a5f7332400855c Mon Sep 17 00:00:00 2001 From: Jevon Date: Mon, 3 Oct 2022 17:40:13 +0100 Subject: [PATCH 06/10] Update appveyor to use VS2022 image --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index f0aa02d6e..415eaa3f1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -image: Visual Studio 2019 +image: Visual Studio 2022 build: verbosity: minimal From b91425e7db7a3ae2b5a9ff3b5ad10b3fc4d32ae6 Mon Sep 17 00:00:00 2001 From: Jevon Date: Mon, 3 Oct 2022 21:01:41 +0100 Subject: [PATCH 07/10] Add reference to MEDI for `netcoreapp3.1` tests --- .../Castle.Windsor.Extensions.DependencyInjection.Tests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj b/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj index 7b9ad6b46..858a4a441 100644 --- a/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj +++ b/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj @@ -20,6 +20,7 @@ + From 61ae0f2e281cc19950f3d31f84bc7a331e2838bf Mon Sep 17 00:00:00 2001 From: Jevon Date: Mon, 3 Oct 2022 21:20:44 +0100 Subject: [PATCH 08/10] Update README to reflect `net462` and `net6.0` usage --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6596c3126..30f33418d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ See the [releases](https://github.com/castleproject/Windsor/releases). ## License -Castle Windsor is © 2004-2020 Castle Project. It is free software, and may be redistributed under the terms of the [Apache 2.0](http://opensource.org/licenses/Apache-2.0) license. +Castle Windsor is © 2004-2022 Castle Project. It is free software, and may be redistributed under the terms of the [Apache 2.0](http://opensource.org/licenses/Apache-2.0) license. ## NuGet Preview Feed @@ -28,7 +28,7 @@ https://ci.appveyor.com/nuget/windsor-qkry8n2r6yak The following conditional compilation symbols are currently defined for Windsor: -Symbol | .NET 4.5 | .NET Standard +Symbol | .NET 4.6.2 | .NET Standard / 6 ----------------------------------- | ------------------ | ------------------ `CASTLE_SERVICES_LOGGING` | :white_check_mark: | :no_entry_sign: `FEATURE_APPDOMAIN` | :white_check_mark: | :no_entry_sign: @@ -58,7 +58,7 @@ Symbol | .NET 4.5 | .NET Standard * `FEATURE_SYSTEM_CONFIGURATION` - enables features that use `System.Configuration` and the `ConfigurationManager`. * `FEATURE_URIMEMBERS` - enables code that uses `Uri.SchemeDelimiter`. -The following conditional compilation symbols are defined for tests only under .NET 4.5: +The following conditional compilation symbols are defined for tests only under .NET 4.6.2: * `FEATURE_CODEDOM` - enables code that uses `System.CodeDom`. * `FEATURE_CONSOLETRACELISTENER` - enables code that requires `System.Diagnostics.ConsoleTraceListener`. * `FEATURE_THREADABORT` - enables code that uses `Thread.Abort()`. From 258ece3a0aebcdce8d7255e642e0d114dd3e7ec2 Mon Sep 17 00:00:00 2001 From: Jevon Date: Tue, 4 Oct 2022 09:35:45 +0100 Subject: [PATCH 09/10] Update dependencies to reflect changes in other PRs, add missing reference to MEDI --- ...Windsor.Extensions.DependencyInjection.Tests.csproj | 1 + ...astle.Windsor.Extensions.DependencyInjection.csproj | 3 +-- .../Castle.Windsor.Extensions.Hosting.csproj | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj b/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj index 858a4a441..6ef705103 100644 --- a/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj +++ b/src/Castle.Windsor.Extensions.DependencyInjection.Tests/Castle.Windsor.Extensions.DependencyInjection.Tests.csproj @@ -25,6 +25,7 @@ + diff --git a/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj b/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj index d2b9fa394..39e554100 100644 --- a/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj +++ b/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj @@ -27,8 +27,7 @@ - - + diff --git a/src/Castle.Windsor.Extensions.Hosting/Castle.Windsor.Extensions.Hosting.csproj b/src/Castle.Windsor.Extensions.Hosting/Castle.Windsor.Extensions.Hosting.csproj index d89336682..88fb0f84d 100644 --- a/src/Castle.Windsor.Extensions.Hosting/Castle.Windsor.Extensions.Hosting.csproj +++ b/src/Castle.Windsor.Extensions.Hosting/Castle.Windsor.Extensions.Hosting.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + netstandard2.0;net6.0 9.0 @@ -19,8 +19,12 @@ Castle.Windsor.Extensions.Hosting - - + + + + + + From bee7b2e2c135e696cb551afd6d1d024254ebec46 Mon Sep 17 00:00:00 2001 From: Jevon Date: Tue, 4 Oct 2022 10:47:45 +0100 Subject: [PATCH 10/10] Update test fixture to stop flakey test affected by order of execution --- .../Castle.Facilities.AspNet.SystemWeb.Tests.csproj | 8 ++++---- .../PerWebRequestTestCase.cs | 10 ++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/Castle.Facilities.AspNet.SystemWeb.Tests/Castle.Facilities.AspNet.SystemWeb.Tests.csproj b/src/Castle.Facilities.AspNet.SystemWeb.Tests/Castle.Facilities.AspNet.SystemWeb.Tests.csproj index a9bfd42d9..fef2d0db9 100644 --- a/src/Castle.Facilities.AspNet.SystemWeb.Tests/Castle.Facilities.AspNet.SystemWeb.Tests.csproj +++ b/src/Castle.Facilities.AspNet.SystemWeb.Tests/Castle.Facilities.AspNet.SystemWeb.Tests.csproj @@ -19,10 +19,10 @@ - - - - + + + + diff --git a/src/Castle.Facilities.AspNet.SystemWeb.Tests/PerWebRequestTestCase.cs b/src/Castle.Facilities.AspNet.SystemWeb.Tests/PerWebRequestTestCase.cs index a858fb68b..dfd658ecb 100644 --- a/src/Castle.Facilities.AspNet.SystemWeb.Tests/PerWebRequestTestCase.cs +++ b/src/Castle.Facilities.AspNet.SystemWeb.Tests/PerWebRequestTestCase.cs @@ -27,14 +27,6 @@ namespace Castle.Facilities.AspNet.SystemWeb.Tests [TestFixture] public class PerWebRequestTestCase { - private FakePerWebRequestLifestyleModule fakeModule; - - [OneTimeSetUp] - public void SetUpFixture() - { - fakeModule = new FakePerWebRequestLifestyleModule(); - } - [Test] public void Should_be_able_to_register_using_attribute_for_per_web_request_lifestyle() { @@ -56,6 +48,8 @@ public void Should_be_able_to_register_using_component_registration_extension_fo [Test] public void Should_be_able_to_register_resolve_and_release_per_web_request_lifestyle_component_using_fake_module() { + var fakeModule = new FakePerWebRequestLifestyleModule(); + var container = new WindsorContainer(); container.Register(Component.For().LifestylePerWebRequest().Named("P"));