コード例 #1
0
 public override object Resolve(Type t)
 {
     try
     {
         return(MyUnityContainer.Resolve(t));
     }
     catch (ResolutionFailedException ex)
     {
         throw new ResolutionFailedException($"Resolution for {t.FullName} failed", ex);
     }
 }
コード例 #2
0
 public override object Resolve(Type t)
 {
     if (!t.IsInterface)
     {
         throw new ResolutionFailedException($"Tried to resolve type {t.FullName}. This is not an interface which indicates a bug.");
     }
     try
     {
         return(MyUnityContainer.Resolve(t));
     }
     catch (Unity.Exceptions.ResolutionFailedException)
     {
         return(Substitute.For(new [] { t }, new object[0]));
     }
 }