Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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.AllTypes["abcd"]);
        }