Skip to content

Commit

Permalink
Switch assert to catch ArgumentException as `InvalidProxyConstructo…
Browse files Browse the repository at this point in the history
…rArgumentsException` is deprecated

castleproject#612 - Updating Windsor to support [email protected] and modern TFMs
  • Loading branch information
Jevonius committed May 14, 2022
1 parent db759e7 commit 4b4a20c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,12 @@ public void Proxying_type_with_no_default_ctor_throws_helpful_message()
.UsingFactoryMethod(() => new ClassWithConstructors("something")));

var exception =
Assert.Throws<InvalidProxyConstructorArgumentsException>(() => Kernel.Resolve<ClassWithConstructors>());
Assert.Throws<ArgumentException>(() => Kernel.Resolve<ClassWithConstructors>());

var expected =
"Can not instantiate proxy of class: Castle.MicroKernel.Tests.Configuration.Components.ClassWithConstructors." + Environment.NewLine +
"Could not find a parameterless constructor.";
"Could not find a parameterless constructor.\r\n" +
"Parameter name: constructorArguments";

Assert.AreEqual(expected, exception.Message);
}
Expand Down

0 comments on commit 4b4a20c

Please sign in to comment.