public void ParsesCosmos(string connString) { Assert.That(TableConnectionString.TryParse(connString, out TableConnectionString tcs), "Parsing should have been successful"); 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.cosmos.azure.com:443/")), "The PrimaryUri should have matched."); }
public void TryParsesStorage(string connString) { Assert.That(TableConnectionString.TryParse(connString, out TableConnectionString tcs), "Parsing should have been successful"); 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."); }
public void ParsesSaSCosmos(string connString) { Assert.That(TableConnectionString.TryParse(connString, out TableConnectionString tcs), "Parsing should have been successful"); Assert.That(tcs.Credentials, Is.Not.Null); Assert.That(GetCredString(tcs.Credentials), Is.EqualTo(SasToken), "The Credentials should have matched."); Assert.That(tcs.TableStorageUri.PrimaryUri, Is.EqualTo(new Uri($"https://{AccountName}.table.cosmos.azure.com/?{SasToken}")), "The PrimaryUri should have matched."); Assert.That(tcs.TableStorageUri.SecondaryUri, Is.EqualTo(new Uri($"https://{AccountName}{TableConstants.ConnectionStrings.SecondaryLocationAccountSuffix}.table.cosmos.azure.com/?{SasToken}")), "The SecondaryUri should have matched."); }
public void ParsesDevStorage() { var connString = $"UseDevelopmentStorage=true"; Assert.That(TableConnectionString.TryParse(connString, out TableConnectionString tcs), "Parsing should have been successful"); Assert.That(tcs.Credentials, Is.Not.Null); Assert.That(GetCredString(tcs.Credentials), Is.EqualTo(GetExpectedHash(_expectedDevStoraageCred)), "The Credentials should have matched."); Assert.That(tcs.TableStorageUri.PrimaryUri, Is.EqualTo(new Uri($"http://{TableConstants.ConnectionStrings.Localhost}:{TableConstants.ConnectionStrings.TableEndpointPortNumber}/{TableConstants.ConnectionStrings.DevStoreAccountName}")), "The PrimaryUri should have matched."); }
public void ParsesSaS() { var connString = $"BlobEndpoint=https://{AccountName}.blob.core.windows.net/;QueueEndpoint=https://{AccountName}.queue.core.windows.net/;FileEndpoint=https://{AccountName}.file.core.windows.net/;TableEndpoint=https://{AccountName}.table.core.windows.net/;SharedAccessSignature={SasToken}"; Assert.That(TableConnectionString.TryParse(connString, out TableConnectionString tcs), "Parsing should have been successful"); Assert.That(tcs.Credentials, Is.Not.Null); Assert.That(GetCredString(tcs.Credentials), Is.EqualTo(SasToken), "The Credentials should have matched."); Assert.That(tcs.TableStorageUri.PrimaryUri, Is.EqualTo(new Uri($"https://{AccountName}.table.core.windows.net/?{SasToken}")), "The PrimaryUri should have matched."); }
public void TryParsesInvalid(string connString) { Assert.That(!TableConnectionString.TryParse(connString, out TableConnectionString tcs), "Parsing should not have been successful"); }
public void ParseFailsWithInvalidConnString(string connString) { Assert.That(TableConnectionString.TryParse(connString, out TableConnectionString tcs), Is.False, "Parsing should not have been successful"); }