anchor.diff:      procedure RegisterType<TInterface: IInterface>(const singleton : boolean;const delegate : TActivatorDelegate<TInterface>; const name : string);overload;
   
       //Resolution
  -    function Resolve<TInterface: IInterface>(const name: string = ''): TInterface; overload;
  +    function Resolve<TInterface: IInterface>(const name: string = ''; const AThrowOnFail : boolean = false): TInterface;
   
       //Default Container - used internally by DUnitX
       class function DefaultContainer : TDUnitXIoC;
  
positive.code:     FContainerInfo : TDictionary<string,TObject>;
  
      private class destructor ClassDestroy;
  
    public
      constructor Create;
  
negative.code: end;
  
  
  function TDUnitXIoC.GetInterfaceKey<TInterface>(const AName: string): string;
  var
    pInfo : PTypeInfo;
  begin
    //By default the key is the interface name unless otherwise found.
    pInfo := TypeInfo(TInterface);
    result := string(pInfo.Name);
  
    if (AName <> '') then
      result := result + '_' + AName;
  
    //All keys are stored in lower case form.
    result := LowerCase(result);
  end;
  
  function TDUnitXIoC.InternalResolve<TInterface>(out AInterface: TInterface; const AName: string): TResolveResult;
  var
    key : string;
    errorMsg : string;
    
    container : TDictionary<string,TObject>;
    registrationObj : TObject;
    registration  : TIoCRegistration<TInterface>;
    resolvedInf : IInterface;
    resolvedObj : TInterface;
    bIsSingleton: Boolean;
    bInstanciate: Boolean;
  begin
    AInterface := Default(TInterface);
    Result := TResolveResult.Unknown;
  
    //Get the key for the interace we are resolving and locate the container for that key.
    key := GetInterfaceKey<TInterface>(AName);
    container := FContainerInfo;
  
    if not container.TryGetValue(key, registrationObj) then
    begin
      result := TResolveResult.InterfaceNotRegistered;
      Exit;
    end;
  
    //Get the interface registration class correctly.
    registration := TIoCRegistration<TInterface>(registrationObj);
    bIsSingleton := registration.IsSingleton;
  
    bInstanciate := true;
  
    if bIsSingleton then
    begin
      //If a singleton was registered with this interface then check if it's already been instanciated.
      if registration.Instance <> nil then
      begin
        //Get AInterface as TInterface
        if registration.Instance.QueryInterface(GetTypeData(TypeInfo(TInterface)).Guid, AInterface) <> 0 then
        begin
          result  := TResolveResult.ImplNotRegistered;
          Exit;
        end;
  
        bInstanciate := False;
      end;
    end;
  
    if bInstanciate then
    begin
      //If the instance hasn't been instanciated then we need to lock and instanciate
      MonitorEnter(container);
      try
        //If we have a implementing class then used this to activate.
        if registration.ImplClass <> nil then
          resolvedInf := TClassActivator.CreateInstance(registration.ImplClass)
        //Otherwise if there is a activate delegate use this to activate.
        else if registration.ActivatorDelegate <> nil then
        begin
          resolvedInf := registration.ActivatorDelegate();
  
          if resolvedInf = nil then
          begin
            result  := TResolveResult.DeletegateFailedCreate;
            Exit;
          end;
        end;
  
        //Get AInterface as TInterface
        if resolvedInf.QueryInterface(GetTypeData(TypeInfo(TInterface)).Guid, resolvedObj) <> 0 then
        begin
          result  := TResolveResult.ImplNotRegistered;
          Exit;
        end;
  
        AInterface := resolvedObj;
  
        if bIsSingleton then
        begin
          registration.Instance := resolvedObj;
  
          //Reset the registration to show the instance which was created.
          container.AddOrSetValue(key, registration);
        end;
      finally
        MonitorExit(container);
      end;
    end;
  end;
  
  procedure TDUnitXIoC.RegisterType<TInterface>(const singleton: boolean; const delegate: TActivatorDelegate<TInterface>; const name: string);
  var
    key   : string;
  