public void handles_derived_cycles_with_resolver() { var schema = new ACyclingDerivingSchema(new FuncDependencyResolver(resolver)); schema.FindType("abcd"); object resolver(Type t) { return(t == typeof(AbstractGraphType) ? new ConcreteGraphType() : null); } }
public void handles_stackoverflow_exception_for_cycle_field_type() { var schema = new ACyclingDerivingSchema(new FuncServiceProvider(t => t == typeof(AbstractGraphType) ? new ConcreteGraphType() : null)); Should.Throw <InvalidOperationException>(() => schema.FindType("abcd")); }