示例#1
0
        public void Lint(Type api)
        {
            var client   = new FakeClient();
            var instance = Activator.CreateInstance(api, client);

            var apiInterface = GetApiInterface(api);

            ApiClientHasAPropertyForApi(api, apiInterface);

            var apiMethods = api.GetMethods(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance);

            AllPublicMethodsAreExposedOnInterface(apiInterface, apiMethods);

            string slackMethodGroup = null;

            foreach (var method in apiMethods)
            {
                client.Reset();
                method.Invoke(instance, method.GetParameters().Select(DummyValue).ToArray());

                LastParamShouldBeOptionalCancellationToken(method);
                AllMethodsShouldUseSameSlackMethodGroup(client, method, ref slackMethodGroup);
                AllArgsShouldBeSnakeCase(client.Args, method);
            }
        }