public void TestGetService()
        {
            // Get the method with two parameters.
            MethodInfo method = typeof(GoogleAdsServiceClientFactory).GetMethods(
                BindingFlags.NonPublic | BindingFlags.Instance)
                                .ToList().Where(delegate(MethodInfo mi)
            {
                return(mi.Name == "GetService" && mi.GetParameters().Length == 2);
            }).First();

            StubIntegrityTestHelper.EnumerateServices <Services>(
                delegate(System.Type serviceSignatureType)
            {
                Assert.DoesNotThrow(delegate()
                {
                    List <System.Type> arguments = new List <System.Type>(
                        serviceSignatureType.GenericTypeArguments);
                    arguments.Add(typeof(GoogleAdsConfig));
                    MethodInfo genericMethod = method.MakeGenericMethod(
                        serviceSignatureType.GenericTypeArguments);
                    object result = genericMethod.Invoke(serviceClientFactory,
                                                         new object[] { null, config });
                });
            });
        }
 public void TestCreateServices()
 {
     StubIntegrityTestHelper.EnumerateServices <AdManagerService>(
         delegate(ServiceSignature serviceSignature)
     {
         Assert.DoesNotThrow(delegate() { user.GetService(serviceSignature); });
     });
 }
 public void TestCreateServices()
 {
     StubIntegrityTestHelper.EnumerateServices <DfpService>(
         delegate(ServiceSignature serviceSignature) {
         Assert.DoesNotThrow(delegate() {
             AdsClient service = user.GetService(serviceSignature);
         });
     });
 }
 public void TestCreateServices()
 {
     StubIntegrityTestHelper.EnumerateServices <AdManagerService>(
         delegate(ServiceSignature serviceSignature)
     {
         Assert.DoesNotThrow(delegate() { user.GetService(serviceSignature); },
                             "Error when creating {0}.{1}",
                             serviceSignature.Version,
                             serviceSignature.ServiceName);
     });
 }
        public void TestGetService()
        {
            MethodInfo method = typeof(GoogleAdsClient).GetMethod("GetService");

            StubIntegrityTestHelper.EnumerateServices <Services>(
                delegate(System.Type serviceSignatureType) {
                Assert.DoesNotThrow(delegate() {
                    MethodInfo genericMethod = method.MakeGenericMethod(
                        serviceSignatureType.GenericTypeArguments);
                    object result = genericMethod.Invoke(googleAdsClient, new object[] { null });
                });
            });
        }
        public void TestGetService()
        {
            MethodInfo method = typeof(GoogleAdsServiceClientFactory).GetMethod("GetService",
                                                                                BindingFlags.NonPublic | BindingFlags.Instance);

            StubIntegrityTestHelper.EnumerateServices <Services>(
                delegate(System.Type serviceSignatureType)
            {
                Assert.DoesNotThrow(delegate()
                {
                    List <System.Type> arguments = new List <System.Type>(
                        serviceSignatureType.GenericTypeArguments);
                    arguments.Add(typeof(GoogleAdsConfig));
                    MethodInfo genericMethod = method.MakeGenericMethod(
                        serviceSignatureType.GenericTypeArguments);
                    object result = genericMethod.Invoke(serviceClientFactory,
                                                         new object[] { null, config });
                });
            });
        }
        public void TestGetService()
        {
            // Get the method with one parameter.
            MethodInfo method = typeof(GoogleAdsClient).GetMethods()
                                .ToList().Where(delegate(MethodInfo mi)
            {
                return(mi.Name == "GetService" && mi.GetParameters().Length == 1);
            }).First();

            StubIntegrityTestHelper.EnumerateServices <Services>(
                delegate(System.Type serviceSignatureType)
            {
                Assert.DoesNotThrow(delegate()
                {
                    MethodInfo genericMethod = method.MakeGenericMethod(
                        serviceSignatureType.GenericTypeArguments);
                    object result = genericMethod.Invoke(googleAdsClient, new object[] { null });
                });
            });
        }