예제 #1
0
        static void Main(string[] args)
        {
            var logger = new Logger("Main");
            var JSON_FILENAME = "configuration.json";

            try
            {

                var config = new Json.Deserializer().parseFromFile<GoogleOAuth2Config>(JSON_FILENAME);
                logger.Write(0, config.ToString());

                var token = new GoogleService.Authenticator().getAuthenticationToken(config);

                logger.Write(0, token);

                 string metrics = "ga:totalEvents";
                string dimensions =
                "ga:date,ga:hostname,ga:pageTitle,ga:dimension1,ga:eventAction,ga:eventCategory,ga:eventLabel";

                GoogleService.Fetch.getQueryAnalyticsResult(token, metrics, dimensions);

            }
            catch (Exception exc)
            {
                logger.Write((MessageType)4, exc.Message);

            }
        }
 public void TestMethod1()
 {
     var myobject = new Json.Deserializer().parseFromFile<GoogleOAuth2Config>("testconfig.json");
     Assert.AreEqual(myobject.GetType(), typeof(GoogleOAuth2Config));
 }