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)); } }
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)); } }
public T Apply(InstanceGenerator instanceGenerator, GenerationTrace trace) { return(_valueGenerator.Value <T>()); }
public T Apply(InstanceGenerator instanceGenerator) { return(_valueGenerator.Value <T>()); }
public object Apply(InstanceGenerator instanceGenerator, GenerationRequest request, Type type) { return(_valueGenerator.Value(type, instanceGenerator, request)); }