Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed that the wrong error message is shown when there are multiple b…

…indings for a unique request.
  • Loading branch information...
commit 04bebff95e9f443dbba08cbf95890350241d8756 1 parent 592932d
@remogloor remogloor authored
View
2  UnzipDependencies.cmd
@@ -1,5 +1,5 @@
tools\nant\nant.exe -buildfile:Ninject.build UnzipDependencies %1 %2 %3 %4 %5 %6 %7 %8
-if %NoPause%=="true" goto ENDBATCHFILE
+if "%NoPause%"=="true" goto ENDBATCHFILE
pause
:ENDBATCHFILE
View
2  build-release.cmd
@@ -24,6 +24,6 @@ echo "BUILD FAILED"
echo "============================================================"
:End
-if %NoPause%=="true" goto ENDBATCHFILE
+if "%NoPause%"=="true" goto ENDBATCHFILE
pause
:ENDBATCHFILE
View
15 src/Ninject.Test/Integration/StandardKernelTests.cs
@@ -56,8 +56,19 @@ public void ActivationExceptionThrownWhenMultipleBindingsAreRegistered()
{
kernel.Bind<IWeapon>().To<Sword>();
kernel.Bind<IWeapon>().To<Shuriken>();
-
- Assert.Throws<ActivationException>(() => kernel.Get<IWeapon>());
+ ActivationException exception = null;
+
+ try
+ {
+ kernel.Get<IWeapon>();
+ }
+ catch (ActivationException e)
+ {
+ exception = e;
+ }
+
+ exception.ShouldNotBeNull();
+ exception.Message.ShouldContain("More than one matching bindings are available.");
}
[Fact]
View
2  src/Ninject/KernelBase.cs
@@ -364,7 +364,7 @@ public virtual IEnumerable<object> Resolve(IRequest request)
return Enumerable.Empty<object>();
}
- throw new ActivationException(ExceptionFormatter.CouldNotResolveBinding(request));
+ throw new ActivationException(ExceptionFormatter.CouldNotUniquelyResolveBinding(request));
}
return bindings.Select(binding => this.CreateContext(request, binding)).Select(context => context.Resolve());
Please sign in to comment.
Something went wrong with that request. Please try again.