Exemple #1
0
        public void TestEndpointMissingOnConfig()
        {
            var config = new JObject
            {
                { "hostname", "hostname.dfs.core.windows.net" },
                { "root", "root" },
                { "tenant", "tenant" },
                { "clientId", "clientId" }
            };
            var adlsAdapter = new ADLSAdapter();

            adlsAdapter.UpdateConfig(config.ToString());
            Assert.AreEqual(AzureCloudEndpoint.AzurePublic, adlsAdapter.Endpoint);
        }
Exemple #2
0
        public void TestFormattedHostname()
        {
            var config = new JObject
            {
                { "hostname", "hostname.dfs.core.windows.net" },
                { "root", "root" },
                { "tenant", "tenant" },
                { "clientId", "clientId" }
            };
            var adlsAdapter = new ADLSAdapter();

            adlsAdapter.UpdateConfig(config.ToString());

            var corpusPath = adlsAdapter.CreateCorpusPath("https://hostname.dfs.core.windows.net/root/partitions/data.csv");

            Assert.AreEqual("/partitions/data.csv", corpusPath);
        }
Exemple #3
0
        public void TestConfigAndUpdateConfigWithoutAuthenticationDetails()
        {
            var adlsAdapter = new ADLSAdapter();

            try
            {
                var config = new JObject
                {
                    { "root", "root" },
                    { "hostname", "hostname" },
                    { "tenant", "tenant" },
                    { "clientId", "clientId" }
                };
                adlsAdapter.UpdateConfig(config.ToString());
                adlsAdapter.Secret    = "secret";
                adlsAdapter.SharedKey = "sharedKey";
            }
            catch
            {
                Assert.Fail("AdlsAdapter initialized without secret shouldn't throw exception when updating config.");
            }
        }