public void Shares_Complete_Tasks_Typed() { IResolveFieldContext <int?> rfc1 = null; IResolveFieldContext <int?> rfc2 = null; var ffr1 = new FuncFieldResolver <int?, Task <string> >(context => { rfc1 = context; return(Task.FromResult("ok")); }); var ffr2 = new FuncFieldResolver <int?, Task <string> >(context => { rfc2 = context; return(Task.FromResult("ok")); }); ffr1.Resolve(_context); ffr2.Resolve(_context); rfc1.ShouldNotBeNull(); rfc1.ShouldNotBeSameAs(_context); rfc2.ShouldNotBeNull(); rfc2.ShouldNotBeSameAs(_context); rfc1.ShouldBe(rfc2); }
public void Shares_Complete_Untyped() { IResolveFieldContext <int?> rfc1 = null; IResolveFieldContext <int?> rfc2 = null; var ffr1 = new FuncFieldResolver <int?, object>(context => { rfc1 = context; return("ok"); }); var ffr2 = new FuncFieldResolver <int?, object>(context => { rfc2 = context; return("ok"); }); ffr1.Resolve(_context); ffr2.Resolve(_context); rfc1.ShouldNotBeNull(); rfc1.ShouldNotBeSameAs(_context); rfc2.ShouldNotBeNull(); rfc2.ShouldNotBeSameAs(_context); rfc1.ShouldBe(rfc2); }
public async Task Shares_Complete_Untyped() { IResolveFieldContext <int?> rfc1 = null; IResolveFieldContext <int?> rfc2 = null; var ffr1 = new FuncFieldResolver <int?, object>(context => { rfc1 = context; return("ok"); }); var ffr2 = new FuncFieldResolver <int?, object>(context => { rfc2 = context; return("ok"); }); await ffr1.ResolveAsync(_context).ConfigureAwait(false); await ffr2.ResolveAsync(_context).ConfigureAwait(false); rfc1.ShouldNotBeNull(); rfc1.ShouldNotBeSameAs(_context); rfc2.ShouldNotBeNull(); rfc2.ShouldNotBeSameAs(_context); rfc1.ShouldBe(rfc2); }