Exemplo n.º 1
0
        public T Apply(InstanceGenerator instanceGenerator, GenerationTrace trace)
        {
            try
            {
                return(_valueGenerator.Value <T>());
            }
            catch (ThirdPartyGeneratorFailed e)
            {
                trace.ThirdPartyGeneratorFailedTryingFallback(e);

                return(_fallbackTypeGenerator.GenerateInstance(instanceGenerator, trace));
            }
            catch (TargetInvocationException e)
            {
                if (Debugger.IsAttached)
                {
                    Console.WriteLine(e);
                }
                return(_fallbackTypeGenerator.GenerateInstance(instanceGenerator, trace));
            }
        }
Exemplo n.º 2
0
 public T Apply(InstanceGenerator instanceGenerator)
 {
     try
     {
         return(_valueGenerator.Value <T>());
     }
     catch (AutoFixture.ObjectCreationException e)
     {
         if (Debugger.IsAttached)
         {
             Console.WriteLine(e);
         }
         return(_fallbackTypeGenerator.GenerateInstance(instanceGenerator));
     }
     catch (TargetInvocationException e)
     {
         if (Debugger.IsAttached)
         {
             Console.WriteLine(e);
         }
         return(_fallbackTypeGenerator.GenerateInstance(instanceGenerator));
     }
 }
Exemplo n.º 3
0
 public T Apply(InstanceGenerator instanceGenerator, GenerationTrace trace)
 {
     return(_valueGenerator.Value <T>());
 }
Exemplo n.º 4
0
 public T Apply(InstanceGenerator instanceGenerator)
 {
     return(_valueGenerator.Value <T>());
 }
Exemplo n.º 5
0
 public object Apply(InstanceGenerator instanceGenerator, GenerationRequest request, Type type)
 {
     return(_valueGenerator.Value(type, instanceGenerator, request));
 }