public void Resolver_IResolverContextTaskOfObject_ResolverNull_ArgExc()
        {
            // arrange
            var descriptor = new Mock <IObjectFieldDescriptor>();

            // act
            void Action() => ResolverObjectFieldDescriptorExtensions.Resolver(
                descriptor.Object,
                default(Func <IResolverContext, Task <object> >) !);

            // assert
            Assert.Throws <ArgumentNullException>(Action);
        }
        public async Task Resolver_IResolverContextObject_ResolverIsSet()
        {
            // arrange
            FieldResolverDelegate resolver = null;
            var resolverFunc = new Func <IResolverContext, object>(_ => "foo");
            var descriptor   = new Mock <IObjectFieldDescriptor>(MockBehavior.Strict);

            descriptor.Setup(t => t.Resolve(It.IsAny <FieldResolverDelegate>()))
            .Returns(
                new Func <FieldResolverDelegate, IObjectFieldDescriptor>(
                    r =>
            {
                resolver = r;
                return(descriptor.Object);
            }));

            // act
            ResolverObjectFieldDescriptorExtensions.Resolver(descriptor.Object, resolverFunc);

            // assert
            Assert.Equal("foo", await resolver.Invoke(
                             new Mock <IResolverContext>().Object));
        }