diff --git a/LightweightIocContainer/IocContainer.cs b/LightweightIocContainer/IocContainer.cs index 7ecba5c..b820f3b 100644 --- a/LightweightIocContainer/IocContainer.cs +++ b/LightweightIocContainer/IocContainer.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Reflection; +using JetBrains.Annotations; using LightweightIocContainer.Exceptions; using LightweightIocContainer.Interfaces; using LightweightIocContainer.Interfaces.Registrations; @@ -201,6 +202,7 @@ namespace LightweightIocContainer /// The type that will be created /// The existing arguments /// An array of all needed constructor arguments to create + [CanBeNull] private object[] ResolveConstructorArguments(Type type, object[] arguments) { //find best ctor diff --git a/LightweightIocContainer/LightweightIocContainer.csproj b/LightweightIocContainer/LightweightIocContainer.csproj index 5d2b1a3..a305561 100644 --- a/LightweightIocContainer/LightweightIocContainer.csproj +++ b/LightweightIocContainer/LightweightIocContainer.csproj @@ -17,6 +17,7 @@ + diff --git a/Test.LightweightIocContainer/IocContainerTest.cs b/Test.LightweightIocContainer/IocContainerTest.cs index 480d09b..7d597d7 100644 --- a/Test.LightweightIocContainer/IocContainerTest.cs +++ b/Test.LightweightIocContainer/IocContainerTest.cs @@ -1,3 +1,4 @@ +using JetBrains.Annotations; using LightweightIocContainer; using LightweightIocContainer.Exceptions; using LightweightIocContainer.Interfaces; @@ -18,6 +19,7 @@ namespace Test.LightweightIocContainer } + [UsedImplicitly] public interface ITestFactory { ITest Create(); @@ -35,6 +37,7 @@ namespace Test.LightweightIocContainer } + [UsedImplicitly] private class TestConstructor : ITest { public TestConstructor(string name, Test test) @@ -87,7 +90,7 @@ namespace Test.LightweightIocContainer IIocContainer iocContainer = new IocContainer(); iocContainer.Register(RegistrationFactory.Register()); - var exception = Assert.Throws(() => iocContainer.Register(RegistrationFactory.Register())); + MultipleRegistrationException exception = Assert.Throws(() => iocContainer.Register(RegistrationFactory.Register())); Assert.AreEqual(typeof(ITest), exception.Type); } @@ -104,7 +107,7 @@ namespace Test.LightweightIocContainer { IIocContainer iocContainer = new IocContainer(); - var exception = Assert.Throws(() => iocContainer.Resolve()); + TypeNotRegisteredException exception = Assert.Throws(() => iocContainer.Resolve()); Assert.AreEqual(typeof(ITest), exception.Type); } @@ -189,7 +192,7 @@ namespace Test.LightweightIocContainer IIocContainer iocContainer = new IocContainer(); iocContainer.Register(RegistrationFactory.Register()); - var exception = Assert.Throws(() => iocContainer.Resolve()); + MultitonResolveException exception = Assert.Throws(() => iocContainer.Resolve()); Assert.AreEqual(typeof(ITest), exception.Type); } @@ -199,7 +202,7 @@ namespace Test.LightweightIocContainer IIocContainer iocContainer = new IocContainer(); iocContainer.Register(RegistrationFactory.Register()); - var exception = Assert.Throws(() => iocContainer.Resolve(new object())); + MultitonResolveException exception = Assert.Throws(() => iocContainer.Resolve(new object())); Assert.AreEqual(typeof(ITest), exception.Type); } diff --git a/Test.LightweightIocContainer/Test.LightweightIocContainer.csproj b/Test.LightweightIocContainer/Test.LightweightIocContainer.csproj index ee759da..5fa4de4 100644 --- a/Test.LightweightIocContainer/Test.LightweightIocContainer.csproj +++ b/Test.LightweightIocContainer/Test.LightweightIocContainer.csproj @@ -7,6 +7,7 @@ +