public void NewTableSasWithInvalidLifeTime() { CloudTable table = tableUtil.CreateTable(); try { DateTime start = DateTime.UtcNow; DateTime end = start.AddHours(1.0); Test.Assert(!CommandAgent.NewAzureStorageTableSAS(table.Name, string.Empty, "d", end, start), "Generate table sas token with invalid should fail"); ExpectedContainErrorMessage("The expiry time of the specified access policy should be greater than start time"); } finally { tableUtil.RemoveTable(table); } }
public void NewTableSasWithNotExistPolicy() { CloudTable table = tableUtil.CreateTable(); try { string policyName = Utility.GenNameString("notexistpolicy"); Test.Assert(!CommandAgent.NewAzureStorageTableSAS(table.Name, policyName, string.Empty), "Generate table sas token with not exist policy should fail"); ExpectedContainErrorMessage(string.Format("Invalid access policy '{0}'.", policyName)); } finally { tableUtil.RemoveTable(table); } }