From 082401e3ac86eaa8e4fa7518382adf245ccaa59e Mon Sep 17 00:00:00 2001 From: Jevon Date: Sat, 14 May 2022 10:34:27 +0100 Subject: [PATCH] Handle variation in how ArgumentException message is formatted depending on runtime #612 - Updating Windsor to support Castle.Core@5.0.0 and modern TFMs --- .../Registration/UsingFactoryMethodTestCase.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Castle.Windsor.Tests/Registration/UsingFactoryMethodTestCase.cs b/src/Castle.Windsor.Tests/Registration/UsingFactoryMethodTestCase.cs index 7a8839a62..1efcf2ede 100644 --- a/src/Castle.Windsor.Tests/Registration/UsingFactoryMethodTestCase.cs +++ b/src/Castle.Windsor.Tests/Registration/UsingFactoryMethodTestCase.cs @@ -451,10 +451,16 @@ public void Proxying_type_with_no_default_ctor_throws_helpful_message() var exception = Assert.Throws(() => Kernel.Resolve()); +#if NET462_OR_GREATER var expected = "Can not instantiate proxy of class: Castle.MicroKernel.Tests.Configuration.Components.ClassWithConstructors." + Environment.NewLine + "Could not find a parameterless constructor.\r\n" + "Parameter name: constructorArguments"; +#else + var expected = + "Can not instantiate proxy of class: Castle.MicroKernel.Tests.Configuration.Components.ClassWithConstructors." + Environment.NewLine + + "Could not find a parameterless constructor. (Parameter 'constructorArguments')"; +#endif Assert.AreEqual(expected, exception.Message); }