From 62627ca923a3ffa2477a3bba8961e684038a63fb Mon Sep 17 00:00:00 2001 From: Simon Gockner Date: Fri, 22 Nov 2019 10:38:28 +0100 Subject: [PATCH] - Refactoring, prepare for #29: - rename IRegistrationBase to IRegistration - split IDefaultRegistraton into IRegistrationBase and a new IDefaultRegistration (same with implementations) --- .../UnknownRegistrationException.cs | 4 +- .../Interfaces/IIocContainer.cs | 20 +- .../Interfaces/Installers/IIocInstaller.cs | 2 +- .../Registrations/IDefaultRegistration.cs | 31 +-- .../Interfaces/Registrations/IRegistration.cs | 24 +++ .../Registrations/IRegistrationBase.cs | 22 +- .../ITypedFactoryRegistration.cs | 2 +- .../IUnitTestCallbackRegistration.cs | 4 +- LightweightIocContainer/IocContainer.cs | 36 ++-- LightweightIocContainer/Lifestyle.cs | 2 +- .../LightweightIocContainer.xml | 193 ++++++++++-------- .../Registrations/DefaultRegistration.cs | 59 +----- .../Registrations/RegistrationBase.cs | 62 ++++++ .../Registrations/RegistrationFactory.cs | 14 +- .../UnitTestCallbackRegistration.cs | 4 +- .../AssemblyInstallerTest.cs | 4 +- ...trationTest.cs => RegistrationBaseTest.cs} | 4 +- 17 files changed, 273 insertions(+), 214 deletions(-) create mode 100644 LightweightIocContainer/Interfaces/Registrations/IRegistration.cs create mode 100644 LightweightIocContainer/Registrations/RegistrationBase.cs rename Test.LightweightIocContainer/{DefaultRegistrationTest.cs => RegistrationBaseTest.cs} (83%) diff --git a/LightweightIocContainer/Exceptions/UnknownRegistrationException.cs b/LightweightIocContainer/Exceptions/UnknownRegistrationException.cs index 0a83286..50b25c2 100644 --- a/LightweightIocContainer/Exceptions/UnknownRegistrationException.cs +++ b/LightweightIocContainer/Exceptions/UnknownRegistrationException.cs @@ -8,12 +8,12 @@ using LightweightIocContainer.Interfaces.Registrations; namespace LightweightIocContainer.Exceptions { /// - /// An unknown was used + /// An unknown was used /// internal class UnknownRegistrationException : Exception { /// - /// An unknown was used + /// An unknown was used /// /// The exception message public UnknownRegistrationException(string message) diff --git a/LightweightIocContainer/Interfaces/IIocContainer.cs b/LightweightIocContainer/Interfaces/IIocContainer.cs index afa8af9..9a667b8 100644 --- a/LightweightIocContainer/Interfaces/IIocContainer.cs +++ b/LightweightIocContainer/Interfaces/IIocContainer.cs @@ -10,7 +10,7 @@ using LightweightIocContainer.Interfaces.Registrations; namespace LightweightIocContainer.Interfaces { /// - /// The main container that carries all the s and can resolve all the types you'll ever want + /// The main container that carries all the s and can resolve all the types you'll ever want /// public interface IIocContainer : IDisposable { @@ -26,17 +26,17 @@ namespace LightweightIocContainer.Interfaces /// /// The Interface to register /// The Type that implements the interface - /// The for this - /// The created - IDefaultRegistration Register(Lifestyle lifestyle = Lifestyle.Transient) where TImplementation : TInterface; + /// The for this + /// The created + IRegistrationBase Register(Lifestyle lifestyle = Lifestyle.Transient) where TImplementation : TInterface; /// /// Register a without an interface /// /// The to register - /// The for this - /// The created - IDefaultRegistration Register(Lifestyle lifestyle = Lifestyle.Transient); + /// The for this + /// The created + IRegistrationBase Register(Lifestyle lifestyle = Lifestyle.Transient); /// /// Register an Interface with a Type that implements it as a multiton @@ -44,14 +44,14 @@ namespace LightweightIocContainer.Interfaces /// The Interface to register /// The Type that implements the interface /// The Type of the multiton scope - /// The created + /// The created IMultitonRegistration Register() where TImplementation : TInterface; /// /// Register an Interface as an abstract typed factory /// /// The abstract typed factory to register - /// The created + /// The created ITypedFactoryRegistration RegisterFactory(); /// @@ -59,7 +59,7 @@ namespace LightweightIocContainer.Interfaces /// /// The Interface to register /// The for the callback - /// The created + /// The created IUnitTestCallbackRegistration RegisterUnitTestCallback(ResolveCallback unitTestCallback); /// diff --git a/LightweightIocContainer/Interfaces/Installers/IIocInstaller.cs b/LightweightIocContainer/Interfaces/Installers/IIocInstaller.cs index fb99ce6..d329bd4 100644 --- a/LightweightIocContainer/Interfaces/Installers/IIocInstaller.cs +++ b/LightweightIocContainer/Interfaces/Installers/IIocInstaller.cs @@ -12,7 +12,7 @@ namespace LightweightIocContainer.Interfaces.Installers public interface IIocInstaller { /// - /// Install the needed s in the given + /// Install the needed s in the given /// /// The current void Install(IIocContainer container); diff --git a/LightweightIocContainer/Interfaces/Registrations/IDefaultRegistration.cs b/LightweightIocContainer/Interfaces/Registrations/IDefaultRegistration.cs index 6c57fd4..3597927 100644 --- a/LightweightIocContainer/Interfaces/Registrations/IDefaultRegistration.cs +++ b/LightweightIocContainer/Interfaces/Registrations/IDefaultRegistration.cs @@ -1,39 +1,20 @@ -// Author: simon.gockner -// Created: 2019-05-20 +// Author: Gockner, Simon +// Created: 2019-11-22 // Copyright(c) 2019 SimonG. All Rights Reserved. using System; -using LightweightIocContainer.Interfaces.Installers; namespace LightweightIocContainer.Interfaces.Registrations { /// - /// The default registration that is used to register a for the Interface it implements + /// The to register a for the Interface it implements /// - /// The registered Interface - public interface IDefaultRegistration : IRegistrationBase + /// The of the interface + public interface IDefaultRegistration : IRegistrationBase { /// - /// The that implements the that is registered with this + /// The that implements the that is registered with this /// Type ImplementationType { get; } - - /// - /// The Lifestyle of Instances that are created with this - /// - Lifestyle Lifestyle { get; } - - /// - /// This is invoked when an instance of this type is created. - /// Can be set in the by calling - /// - Action OnCreateAction { get; } - - /// - /// Pass an that will be invoked when an instance of this type is created - /// - /// The - /// The current instance of this - IDefaultRegistration OnCreate(Action action); } } \ No newline at end of file diff --git a/LightweightIocContainer/Interfaces/Registrations/IRegistration.cs b/LightweightIocContainer/Interfaces/Registrations/IRegistration.cs new file mode 100644 index 0000000..65d6dd6 --- /dev/null +++ b/LightweightIocContainer/Interfaces/Registrations/IRegistration.cs @@ -0,0 +1,24 @@ +// Author: simon.gockner +// Created: 2019-05-20 +// Copyright(c) 2019 SimonG. All Rights Reserved. + +using System; + +namespace LightweightIocContainer.Interfaces.Registrations +{ + /// + /// The base registration that is used to register an Interface + /// + public interface IRegistration + { + /// + /// The name of the + /// + string Name { get; } + + /// + /// The of the Interface that is registered with this + /// + Type InterfaceType { get; } + } +} \ No newline at end of file diff --git a/LightweightIocContainer/Interfaces/Registrations/IRegistrationBase.cs b/LightweightIocContainer/Interfaces/Registrations/IRegistrationBase.cs index cc39e41..d106bbf 100644 --- a/LightweightIocContainer/Interfaces/Registrations/IRegistrationBase.cs +++ b/LightweightIocContainer/Interfaces/Registrations/IRegistrationBase.cs @@ -3,22 +3,32 @@ // Copyright(c) 2019 SimonG. All Rights Reserved. using System; +using LightweightIocContainer.Interfaces.Installers; namespace LightweightIocContainer.Interfaces.Registrations { /// - /// The base registration that is used to register an Interface + /// The that is used to register an Interface /// - public interface IRegistrationBase + /// The registered Interface + public interface IRegistrationBase : IRegistration { /// - /// The name of the + /// The Lifestyle of Instances that are created with this /// - string Name { get; } + Lifestyle Lifestyle { get; } /// - /// The of the Interface that is registered with this + /// This is invoked when an instance of this type is created. + /// Can be set in the by calling /// - Type InterfaceType { get; } + Action OnCreateAction { get; } + + /// + /// Pass an that will be invoked when an instance of this type is created + /// + /// The + /// The current instance of this + IRegistrationBase OnCreate(Action action); } } \ No newline at end of file diff --git a/LightweightIocContainer/Interfaces/Registrations/ITypedFactoryRegistration.cs b/LightweightIocContainer/Interfaces/Registrations/ITypedFactoryRegistration.cs index 584a290..12c361e 100644 --- a/LightweightIocContainer/Interfaces/Registrations/ITypedFactoryRegistration.cs +++ b/LightweightIocContainer/Interfaces/Registrations/ITypedFactoryRegistration.cs @@ -10,7 +10,7 @@ namespace LightweightIocContainer.Interfaces.Registrations /// The registration that is used to register an abstract typed factory /// /// The type of the abstract typed factory - public interface ITypedFactoryRegistration : IRegistrationBase + public interface ITypedFactoryRegistration : IRegistration { /// /// The class that contains the implemented abstract factory of this diff --git a/LightweightIocContainer/Interfaces/Registrations/IUnitTestCallbackRegistration.cs b/LightweightIocContainer/Interfaces/Registrations/IUnitTestCallbackRegistration.cs index e5831d8..2dd0123 100644 --- a/LightweightIocContainer/Interfaces/Registrations/IUnitTestCallbackRegistration.cs +++ b/LightweightIocContainer/Interfaces/Registrations/IUnitTestCallbackRegistration.cs @@ -5,10 +5,10 @@ namespace LightweightIocContainer.Interfaces.Registrations { /// - /// A special that allows to set a as a callback that is called on + /// A special that allows to set a as a callback that is called on /// /// - public interface IUnitTestCallbackRegistration : IRegistrationBase + public interface IUnitTestCallbackRegistration : IRegistration { /// /// An that is set as a callback that is called on diff --git a/LightweightIocContainer/IocContainer.cs b/LightweightIocContainer/IocContainer.cs index 0112cfd..4c9df25 100644 --- a/LightweightIocContainer/IocContainer.cs +++ b/LightweightIocContainer/IocContainer.cs @@ -17,19 +17,19 @@ using LightweightIocContainer.Registrations; namespace LightweightIocContainer { /// - /// The main container that carries all the s and can resolve all the types you'll ever want + /// The main container that carries all the s and can resolve all the types you'll ever want /// public class IocContainer : IIocContainer { private readonly RegistrationFactory _registrationFactory; - private readonly List _registrations = new List(); + private readonly List _registrations = new List(); private readonly List<(Type type, object instance)> _singletons = new List<(Type, object)>(); private readonly List<(Type type, Type scope, ConditionalWeakTable instances)> _multitons = new List<(Type, Type, ConditionalWeakTable)>(); /// - /// The main container that carries all the s and can resolve all the types you'll ever want + /// The main container that carries all the s and can resolve all the types you'll ever want /// public IocContainer() { @@ -57,11 +57,11 @@ namespace LightweightIocContainer /// /// The Interface to register /// The Type that implements the interface - /// The for this - /// The created - public IDefaultRegistration Register(Lifestyle lifestyle = Lifestyle.Transient) where TImplementation : TInterface + /// The for this + /// The created + public IRegistrationBase Register(Lifestyle lifestyle = Lifestyle.Transient) where TImplementation : TInterface { - IDefaultRegistration registration = _registrationFactory.Register(lifestyle); + IRegistrationBase registration = _registrationFactory.Register(lifestyle); Register(registration); return registration; @@ -71,11 +71,11 @@ namespace LightweightIocContainer /// Register a without an interface /// /// The to register - /// The for this - /// The created - public IDefaultRegistration Register(Lifestyle lifestyle = Lifestyle.Transient) + /// The for this + /// The created + public IRegistrationBase Register(Lifestyle lifestyle = Lifestyle.Transient) { - IDefaultRegistration registration = _registrationFactory.Register(lifestyle); + IRegistrationBase registration = _registrationFactory.Register(lifestyle); Register(registration); return registration; @@ -87,7 +87,7 @@ namespace LightweightIocContainer /// The Interface to register /// The Type that implements the interface /// The Type of the multiton scope - /// The created + /// The created public IMultitonRegistration Register() where TImplementation : TInterface { IMultitonRegistration registration = _registrationFactory.Register(); @@ -100,7 +100,7 @@ namespace LightweightIocContainer /// Register an Interface as an abstract typed factory /// /// The abstract typed factory to register - /// The created + /// The created public ITypedFactoryRegistration RegisterFactory() { ITypedFactoryRegistration registration = _registrationFactory.RegisterFactory(); @@ -114,7 +114,7 @@ namespace LightweightIocContainer /// /// The Interface to register /// The for the callback - /// The created + /// The created public IUnitTestCallbackRegistration RegisterUnitTestCallback(ResolveCallback unitTestCallback) { IUnitTestCallbackRegistration registration = _registrationFactory.RegisterUnitTestCallback(unitTestCallback); @@ -124,11 +124,11 @@ namespace LightweightIocContainer } /// - /// Add the to the the + /// Add the to the the /// - /// The given + /// The given /// The is already registered in this - private void Register(IRegistrationBase registration) + private void Register(IRegistration registration) { //if type is already registered if (_registrations.Any(r => r.InterfaceType == registration.InterfaceType)) @@ -195,7 +195,7 @@ namespace LightweightIocContainer /// The registration for the given has an unknown private T ResolveInternal(object[] arguments, List resolveStack = null) { - IRegistrationBase registration = _registrations.FirstOrDefault(r => r.InterfaceType == typeof(T)); + IRegistration registration = _registrations.FirstOrDefault(r => r.InterfaceType == typeof(T)); if (registration == null) throw new TypeNotRegisteredException(typeof(T)); diff --git a/LightweightIocContainer/Lifestyle.cs b/LightweightIocContainer/Lifestyle.cs index d3dc7fc..a7141d3 100644 --- a/LightweightIocContainer/Lifestyle.cs +++ b/LightweightIocContainer/Lifestyle.cs @@ -7,7 +7,7 @@ using LightweightIocContainer.Interfaces.Registrations; namespace LightweightIocContainer { /// - /// The Lifestyles that can be used for a + /// The Lifestyles that can be used for a /// public enum Lifestyle { diff --git a/LightweightIocContainer/LightweightIocContainer.xml b/LightweightIocContainer/LightweightIocContainer.xml index e0c48cb..abd02ce 100644 --- a/LightweightIocContainer/LightweightIocContainer.xml +++ b/LightweightIocContainer/LightweightIocContainer.xml @@ -222,12 +222,12 @@ - An unknown was used + An unknown was used - An unknown was used + An unknown was used The exception message @@ -295,7 +295,7 @@ - The main container that carries all the s and can resolve all the types you'll ever want + The main container that carries all the s and can resolve all the types you'll ever want @@ -311,16 +311,16 @@ The Interface to register The Type that implements the interface - The for this - The created + The for this + The created Register a without an interface The to register - The for this - The created + The for this + The created @@ -329,14 +329,14 @@ The Interface to register The Type that implements the interface The Type of the multiton scope - The created + The created Register an Interface as an abstract typed factory The abstract typed factory to register - The created + The created @@ -344,7 +344,7 @@ The Interface to register The for the callback - The created + The created @@ -391,64 +391,70 @@ - Install the needed s in the given + Install the needed s in the given The current - The default registration that is used to register a for the Interface it implements + The to register a for the Interface it implements - The registered Interface + The of the interface - The that implements the that is registered with this + The that implements the that is registered with this - + - The Lifestyle of Instances that are created with this + The registration that is used to register a multiton + The registered interface - + - This is invoked when an instance of this type is created. - Can be set in the by calling + The of the multiton scope - + - Pass an that will be invoked when an instance of this type is created + The base registration that is used to register an Interface - The - The current instance of this - + - The registration that is used to register a multiton + The name of the - The registered interface - + - The of the multiton scope + The of the Interface that is registered with this - + - The base registration that is used to register an Interface + The that is used to register an Interface + The registered Interface - + - The name of the + The Lifestyle of Instances that are created with this - + - The of the Interface that is registered with this + This is invoked when an instance of this type is created. + Can be set in the by calling + + + + + Pass an that will be invoked when an instance of this type is created + The + The current instance of this @@ -463,7 +469,7 @@ - A special that allows to set a as a callback that is called on + A special that allows to set a as a callback that is called on @@ -474,12 +480,12 @@ - The main container that carries all the s and can resolve all the types you'll ever want + The main container that carries all the s and can resolve all the types you'll ever want - The main container that carries all the s and can resolve all the types you'll ever want + The main container that carries all the s and can resolve all the types you'll ever want @@ -495,16 +501,16 @@ The Interface to register The Type that implements the interface - The for this - The created + The for this + The created Register a without an interface The to register - The for this - The created + The for this + The created @@ -513,14 +519,14 @@ The Interface to register The Type that implements the interface The Type of the multiton scope - The created + The created Register an Interface as an abstract typed factory The abstract typed factory to register - The created + The created @@ -528,13 +534,13 @@ The Interface to register The for the callback - The created + The created - + - Add the to the the + Add the to the the - The given + The given The is already registered in this @@ -640,7 +646,7 @@ - The Lifestyles that can be used for a + The Lifestyles that can be used for a @@ -660,73 +666,86 @@ - The default registration that is used to register a for the Interface it implements + The to register a for the Interface it implements - The registered Interface + The of the interface - The default registration that is used to register a for the Interface it implements + The to register a for the Interface it implements - The of the Interface - The of the Implementation - The of the registration + The of the interface + The of the implementation + The of the - + - The name of the + The that implements the that is registered with this - + - The of the Interface that is registered with this + The registration that is used to register a multiton + The registered interface - + - The that implements the that is registered with this + The registration that is used to register a multiton + The of the Interface + The of the Implementation + The of the Multiton Scope - + - The of Instances that are created with this + The of the multiton scope - + - This is invoked when an instance of this type is created. - Can be set in the by calling + The that is used to register an Interface + The registered Interface - + - Pass an that will be invoked when an instance of this is created + The that is used to register an Interface - The - The current instance of this + The of the Interface + The of the registration - + - The registration that is used to register a multiton + The name of the - The registered interface - + - The registration that is used to register a multiton + The of the Interface that is registered with this - The of the Interface - The of the Implementation - The of the Multiton Scope - + - The of the multiton scope + The of Instances that are created with this + + + + + This is invoked when an instance of this type is created. + Can be set in the by calling + + + + + Pass an that will be invoked when an instance of this is created + The + The current instance of this - A factory to register interfaces and factories in an and create the needed s + A factory to register interfaces and factories in an and create the needed s @@ -735,16 +754,16 @@ The Interface to register The Type that implements the interface - The for this - A new created with the given parameters + The for this + A new created with the given parameters - Register a without an interface and create a + Register a without an interface and create a The to register - The for this - A new created with the given parameters + The for this + A new created with the given parameters @@ -799,13 +818,13 @@ - A special that allows to set a as a callback that is called on + A special that allows to set a as a callback that is called on - A special that allows to set a as a callback that is called on + A special that allows to set a as a callback that is called on The of the interface The that is set as a callback diff --git a/LightweightIocContainer/Registrations/DefaultRegistration.cs b/LightweightIocContainer/Registrations/DefaultRegistration.cs index 9aa0b34..f8c5c47 100644 --- a/LightweightIocContainer/Registrations/DefaultRegistration.cs +++ b/LightweightIocContainer/Registrations/DefaultRegistration.cs @@ -1,71 +1,34 @@ -// Author: simon.gockner -// Created: 2019-05-20 +// Author: Gockner, Simon +// Created: 2019-11-22 // Copyright(c) 2019 SimonG. All Rights Reserved. using System; -using LightweightIocContainer.Interfaces.Installers; using LightweightIocContainer.Interfaces.Registrations; namespace LightweightIocContainer.Registrations { /// - /// The default registration that is used to register a for the Interface it implements + /// The to register a for the Interface it implements /// - /// The registered Interface - public class DefaultRegistration : IDefaultRegistration + /// The of the interface + public class DefaultRegistration : RegistrationBase, IDefaultRegistration { /// - /// The default registration that is used to register a for the Interface it implements + /// The to register a for the Interface it implements /// - /// The of the Interface - /// The of the Implementation - /// The of the registration + /// The of the interface + /// The of the implementation + /// The of the public DefaultRegistration(Type interfaceType, Type implementationType, Lifestyle lifestyle) + : base(interfaceType, lifestyle) { - InterfaceType = interfaceType; ImplementationType = implementationType; - Lifestyle = lifestyle; - Name = $"{InterfaceType.Name}, {ImplementationType.Name}, Lifestyle: {Lifestyle.ToString()}"; } /// - /// The name of the - /// - public string Name { get; } - - /// - /// The of the Interface that is registered with this - /// - public Type InterfaceType { get; } - - /// - /// The that implements the that is registered with this + /// The that implements the that is registered with this /// public Type ImplementationType { get; } - - /// - /// The of Instances that are created with this - /// - public Lifestyle Lifestyle { get; } - - - /// - /// This is invoked when an instance of this type is created. - /// Can be set in the by calling - /// - public Action OnCreateAction { get; private set; } - - - /// - /// Pass an that will be invoked when an instance of this is created - /// - /// The - /// The current instance of this - public IDefaultRegistration OnCreate(Action action) - { - OnCreateAction = action; - return this; - } } } \ No newline at end of file diff --git a/LightweightIocContainer/Registrations/RegistrationBase.cs b/LightweightIocContainer/Registrations/RegistrationBase.cs new file mode 100644 index 0000000..3c77b39 --- /dev/null +++ b/LightweightIocContainer/Registrations/RegistrationBase.cs @@ -0,0 +1,62 @@ +// Author: simon.gockner +// Created: 2019-05-20 +// Copyright(c) 2019 SimonG. All Rights Reserved. + +using System; +using LightweightIocContainer.Interfaces.Installers; +using LightweightIocContainer.Interfaces.Registrations; + +namespace LightweightIocContainer.Registrations +{ + /// + /// The that is used to register an Interface + /// + /// The registered Interface + public abstract class RegistrationBase : IRegistrationBase + { + /// + /// The that is used to register an Interface + /// + /// The of the Interface + /// The of the registration + protected RegistrationBase(Type interfaceType, Lifestyle lifestyle) + { + InterfaceType = interfaceType; + Lifestyle = lifestyle; + } + + /// + /// The name of the + /// + public string Name { get; protected set; } + + /// + /// The of the Interface that is registered with this + /// + public Type InterfaceType { get; } + + /// + /// The of Instances that are created with this + /// + public Lifestyle Lifestyle { get; } + + + /// + /// This is invoked when an instance of this type is created. + /// Can be set in the by calling + /// + public Action OnCreateAction { get; private set; } + + + /// + /// Pass an that will be invoked when an instance of this is created + /// + /// The + /// The current instance of this + public IRegistrationBase OnCreate(Action action) + { + OnCreateAction = action; + return this; + } + } +} \ No newline at end of file diff --git a/LightweightIocContainer/Registrations/RegistrationFactory.cs b/LightweightIocContainer/Registrations/RegistrationFactory.cs index 1482424..e424f8b 100644 --- a/LightweightIocContainer/Registrations/RegistrationFactory.cs +++ b/LightweightIocContainer/Registrations/RegistrationFactory.cs @@ -11,7 +11,7 @@ using LightweightIocContainer.Interfaces.Registrations; namespace LightweightIocContainer.Registrations { /// - /// A factory to register interfaces and factories in an and create the needed s + /// A factory to register interfaces and factories in an and create the needed s /// internal class RegistrationFactory { @@ -27,20 +27,20 @@ namespace LightweightIocContainer.Registrations /// /// The Interface to register /// The Type that implements the interface - /// The for this - /// A new created with the given parameters + /// The for this + /// A new created with the given parameters public IDefaultRegistration Register(Lifestyle lifestyle) where TImplementation : TInterface { return new DefaultRegistration(typeof(TInterface), typeof(TImplementation), lifestyle); } /// - /// Register a without an interface and create a + /// Register a without an interface and create a /// /// The to register - /// The for this - /// A new created with the given parameters - public IDefaultRegistration Register(Lifestyle lifestyle) + /// The for this + /// A new created with the given parameters + public IRegistrationBase Register(Lifestyle lifestyle) { if (typeof(TImplementation).IsInterface) throw new InvalidRegistrationException("Can't register an interface without its implementation type."); diff --git a/LightweightIocContainer/Registrations/UnitTestCallbackRegistration.cs b/LightweightIocContainer/Registrations/UnitTestCallbackRegistration.cs index 8f6e171..529d1e5 100644 --- a/LightweightIocContainer/Registrations/UnitTestCallbackRegistration.cs +++ b/LightweightIocContainer/Registrations/UnitTestCallbackRegistration.cs @@ -9,13 +9,13 @@ using LightweightIocContainer.Interfaces.Registrations; namespace LightweightIocContainer.Registrations { /// - /// A special that allows to set a as a callback that is called on + /// A special that allows to set a as a callback that is called on /// /// public class UnitTestCallbackRegistration : IUnitTestCallbackRegistration { /// - /// A special that allows to set a as a callback that is called on + /// A special that allows to set a as a callback that is called on /// /// The of the interface /// The that is set as a callback diff --git a/Test.LightweightIocContainer/AssemblyInstallerTest.cs b/Test.LightweightIocContainer/AssemblyInstallerTest.cs index 30874e0..c605328 100644 --- a/Test.LightweightIocContainer/AssemblyInstallerTest.cs +++ b/Test.LightweightIocContainer/AssemblyInstallerTest.cs @@ -25,7 +25,7 @@ namespace Test.LightweightIocContainer { public void Install(IIocContainer container) { - container.Register>(); + container.Register>(); } } @@ -54,7 +54,7 @@ namespace Test.LightweightIocContainer AssemblyInstaller assemblyInstaller = new AssemblyInstaller(assemblyMock.Object); assemblyInstaller.Install(iocContainerMock.Object); - iocContainerMock.Verify(ioc => ioc.Register>>(It.IsAny()), Times.Once); + iocContainerMock.Verify(ioc => ioc.Register>>(It.IsAny()), Times.Once); } [Test] diff --git a/Test.LightweightIocContainer/DefaultRegistrationTest.cs b/Test.LightweightIocContainer/RegistrationBaseTest.cs similarity index 83% rename from Test.LightweightIocContainer/DefaultRegistrationTest.cs rename to Test.LightweightIocContainer/RegistrationBaseTest.cs index 70cb966..8e0cd28 100644 --- a/Test.LightweightIocContainer/DefaultRegistrationTest.cs +++ b/Test.LightweightIocContainer/RegistrationBaseTest.cs @@ -13,7 +13,7 @@ using NUnit.Framework; namespace Test.LightweightIocContainer { [TestFixture] - public class DefaultRegistrationTest + public class RegistrationBaseTest { #region TestClasses @@ -37,7 +37,7 @@ namespace Test.LightweightIocContainer public void TestOnCreate() { RegistrationFactory registrationFactory = new RegistrationFactory(new Mock().Object); - IDefaultRegistration testRegistration = registrationFactory.Register(Lifestyle.Transient).OnCreate(t => t.DoSomething()); + IRegistrationBase testRegistration = registrationFactory.Register(Lifestyle.Transient).OnCreate(t => t.DoSomething()); ITest test = new Test();