Skip to content

Commit

Permalink
Handle variation in how ArgumentException message is formatted depend…
Browse files Browse the repository at this point in the history
…ing on runtime

castleproject#612 - Updating Windsor to support [email protected] and modern TFMs
  • Loading branch information
Jevonius committed May 14, 2022
1 parent f0ad3e1 commit efc5d28
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,16 @@ public void Proxying_type_with_no_default_ctor_throws_helpful_message()
var exception =
Assert.Throws<ArgumentException>(() => Kernel.Resolve<ClassWithConstructors>());

#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);
}
Expand Down

0 comments on commit efc5d28

Please sign in to comment.