Exemplo n.º 1
0
        private void Initialize()
        {
            var config = new ConfigurationBuilder()
                         .SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
                         .AddUserSecrets <ZohoClientTests>()
                         .Build();

            UserConfig uc = config.Get <UserConfig>();

            zohoClient = new Zoho.ZohoClient(new Uri(uc.url), uc.clientId, uc.clientSecret, uc.RefreshToken);
        }
Exemplo n.º 2
0
        public void TestConnect_Failed()
        {
            try
            {
                var config = new ConfigurationBuilder()
                             .SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
                             .AddUserSecrets <ZohoClient>()
                             .Build();

                UserConfig uc = config.Get <UserConfig>();

                zohoClient = new Zoho.ZohoClient(new Uri(uc.url), "sadadasd", uc.clientSecret, uc.RefreshToken);

                Assert.IsNull(zohoClient.Token.AccessToken);
                Assert.IsTrue(zohoClient.Token.ExpiresIn != 0);
            }
            catch
            {
            }
        }