-
-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
RegisterInstance(...)
The method is defined by IUnityContainer as the following:
IUnityContainer RegisterInstance(Type type, string name, object instance, IInstanceLifetimeManager lifetimeManager);Registered Type
Registration Type is determined either by explicit parameter type, or implicitly from type of the instance. When method RegisterInstance(...) is called with both type and instance as null` exception is thrown.
Exception
By convention, when argument is null, exception System.ArgumentNullException should be thrown. Instead, Unity throws System.InvalidOperationException
Solution
Unity must throw correct exception: System.ArgumentNullException