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); }
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); }
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."); } }