public void ParseCosmosEmulatorConnString()
        {
            var uri = "DefaultEndpointsProtocol=http;AccountName=localhost;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==;TableEndpoint=http://localhost:8902/;";

            var result = TableConnectionString.Parse(uri);

            Assert.AreEqual("localhost", result._accountName);
        }
        public void ParseAzuriteConnString()
        {
            var uri = "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;";

            var result = TableConnectionString.Parse(uri);

            Assert.AreEqual("devstoreaccount1", result._accountName);
        }
예제 #3
0
        public void ParsesStorage(string connString)
        {
            var tcs = TableConnectionString.Parse(connString);

            Assert.That(tcs.Credentials, Is.Not.Null);
            Assert.That(GetCredString(tcs.Credentials), Is.EqualTo(GetExpectedHash(_expectedCred)), "The Credentials should have matched.");
            Assert.That(tcs.TableStorageUri.PrimaryUri, Is.EqualTo(new Uri($"https://{AccountName}.table.core.windows.net/")), "The PrimaryUri should have matched.");
            Assert.That(tcs.TableStorageUri.SecondaryUri, Is.EqualTo(new Uri($"https://{AccountName}{TableConstants.ConnectionStrings.SecondaryLocationAccountSuffix}.table.core.windows.net/")), "The SecondaryUri should have matched.");
        }
예제 #4
0
 public void ParsesInvalid(string connString)
 {
     Assert.Throws <InvalidOperationException>(() => TableConnectionString.Parse(connString), "Parsing should not have been successful");
 }