public void CreateContainer_ValidArgumentsWithNoPublicAccess_CreatesContainerWithNoPublicAccess() { var containerName = GenerateSampleContainerName(); IBlobServiceClient client = new BlobServiceClient(AccountSettings); client.CreateContainer(containerName, ContainerAccessType.None); AssertContainerAccess(containerName, Microsoft.WindowsAzure.Storage.Blob.BlobContainerPublicAccessType.Off); }
public void CreateContainer_ValidArguments_CreatesContainerWithSpecificName() { var containerName = GenerateSampleContainerName(); IBlobServiceClient client = new BlobServiceClient(AccountSettings); client.CreateContainer(containerName, ContainerAccessType.None); AssertContainerExists(containerName); }
public void CreateContainer_AlreadyExists_ThrowsContainerAlreadyExistsException() { var containerName = GenerateSampleContainerName(); CreateContainer(containerName); IBlobServiceClient client = new BlobServiceClient(AccountSettings); client.CreateContainer(containerName, ContainerAccessType.None); // expects exception }
public void CreateContainer_ValidArguments_ReturnsContainerCreationResponse() { var containerName = GenerateSampleContainerName(); IBlobServiceClient client = new BlobServiceClient(AccountSettings); var response = client.CreateContainer(containerName, ContainerAccessType.None); Assert.IsTrue(response.Date > DateTime.Now.AddSeconds(-5), String.Format("Response Date was set to {0}", response.Date)); Assert.IsTrue(response.LastModified > DateTime.Now.AddSeconds(-5), String.Format("Response LastModified was set to {0}", response.LastModified)); Assert.IsFalse(string.IsNullOrWhiteSpace(response.ETag), "Response ETag is not set"); }