Skip to content

Commit

Permalink
Fix instantiate typo on component registration exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianoKiss authored Mar 24, 2021
1 parent 880d8a8 commit 28e7afa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/Castle.Windsor.Tests/MicroKernelTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public void ShouldNotRegisterAbstractClassAsComponentImplementation_With_Lifesty

var expectedMessage =
string.Format(
"Type Castle.MicroKernel.Tests.ClassComponents.BaseCommonComponent is abstract.{0} As such, it is not possible to instansiate it as implementation of service 'abstract'. Did you forget to proxy it?",
"Type Castle.MicroKernel.Tests.ClassComponents.BaseCommonComponent is abstract.{0} As such, it is not possible to instantiate it as implementation of service 'abstract'. Did you forget to proxy it?",
Environment.NewLine);
var exception =
Assert.Throws(typeof(ComponentRegistrationException), () =>
Expand All @@ -298,7 +298,7 @@ public void ShouldNotRegisterAbstractClassAsComponentImplementation_With_Lifesty
Kernel.Register(Component.For<ICommon>().ImplementedBy<BaseCommonComponent>().Named("abstract").LifeStyle.Pooled);
var expectedMessage =
string.Format(
"Type Castle.MicroKernel.Tests.ClassComponents.BaseCommonComponent is abstract.{0} As such, it is not possible to instansiate it as implementation of service 'abstract'. Did you forget to proxy it?",
"Type Castle.MicroKernel.Tests.ClassComponents.BaseCommonComponent is abstract.{0} As such, it is not possible to instantiate it as implementation of service 'abstract'. Did you forget to proxy it?",
Environment.NewLine);
var exception =
Assert.Throws(typeof(ComponentRegistrationException), () => Kernel.Resolve<ICommon>("abstract"));
Expand All @@ -312,7 +312,7 @@ public void ShouldNotRegisterAbstractClassAsComponentImplementation_With_Simple_

var expectedMessage =
string.Format(
"Type Castle.MicroKernel.Tests.ClassComponents.BaseCommonComponent is abstract.{0} As such, it is not possible to instansiate it as implementation of service 'abstract'. Did you forget to proxy it?",
"Type Castle.MicroKernel.Tests.ClassComponents.BaseCommonComponent is abstract.{0} As such, it is not possible to instantiate it as implementation of service 'abstract'. Did you forget to proxy it?",
Environment.NewLine);
var exception =
Assert.Throws(typeof(ComponentRegistrationException), () => Kernel.Resolve<ICommon>("abstract"));
Expand All @@ -326,7 +326,7 @@ public void ShouldNotRegisterAbstractClass_With_LifestyleType_And_Override_Signa

var expectedMessage =
string.Format(
"Type Castle.MicroKernel.Tests.ClassComponents.BaseCommonComponent is abstract.{0} As such, it is not possible to instansiate it as implementation of service 'abstract'. Did you forget to proxy it?",
"Type Castle.MicroKernel.Tests.ClassComponents.BaseCommonComponent is abstract.{0} As such, it is not possible to instantiate it as implementation of service 'abstract'. Did you forget to proxy it?",
Environment.NewLine);
var exception =
Assert.Throws<ComponentRegistrationException>(() => Kernel.Resolve<ICommon>("abstract"));
Expand All @@ -340,7 +340,7 @@ public void ShouldNotRegisterAbstractClass_With_LifestyleType_Signature()

var expectedMessage =
string.Format(
"Type Castle.MicroKernel.Tests.ClassComponents.BaseCommonComponent is abstract.{0} As such, it is not possible to instansiate it as implementation of service 'abstract'. Did you forget to proxy it?",
"Type Castle.MicroKernel.Tests.ClassComponents.BaseCommonComponent is abstract.{0} As such, it is not possible to instantiate it as implementation of service 'abstract'. Did you forget to proxy it?",
Environment.NewLine);
var exception =
Assert.Throws(typeof(ComponentRegistrationException), () => Kernel.Resolve<ICommon>("abstract"));
Expand All @@ -353,7 +353,7 @@ public void ShouldNotRegisterAbstractClass_With_Simple_Signature()
Kernel.Register(Component.For<BaseCommonComponent>().Named("abstract"));
var expectedMessage =
string.Format(
"Type Castle.MicroKernel.Tests.ClassComponents.BaseCommonComponent is abstract.{0} As such, it is not possible to instansiate it as implementation of service 'abstract'. Did you forget to proxy it?",
"Type Castle.MicroKernel.Tests.ClassComponents.BaseCommonComponent is abstract.{0} As such, it is not possible to instantiate it as implementation of service 'abstract'. Did you forget to proxy it?",
Environment.NewLine);
var exception =
Assert.Throws(typeof(ComponentRegistrationException), () => Kernel.Resolve<ICommon>("abstract"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected virtual object CreateInstance(CreationContext context, ConstructorCand
{
throw new ComponentRegistrationException(
string.Format(
"Type {0} is abstract.{2} As such, it is not possible to instansiate it as implementation of service '{1}'. Did you forget to proxy it?",
"Type {0} is abstract.{2} As such, it is not possible to instantiate it as implementation of service '{1}'. Did you forget to proxy it?",
Model.Implementation.FullName,
Model.Name,
Environment.NewLine));
Expand Down

0 comments on commit 28e7afa

Please sign in to comment.