Ejemplo n.º 1
0
 public void PersistKeysToAzureBlobStorage_should_throw_ArgumentNulException_on_builder_null()
 {
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(null, blobReference: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), blobReference: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(null, blobUri: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), blobUri: null));
     Assert.Throws <ArgumentException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), new Uri("http://www.example.com")));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(null, blobUri: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(null, storageAccount: null, null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), storageAccount: null, null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), new CloudStorageAccount(new StorageCredentials("test", "test"), true), null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(null, container: null, null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), container: null, null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), new CloudBlobContainer(new Uri("http://www.example.com")), null));
 }
 public void PersistKeysToAzureBlobStorage_should_throw_ArgumentNulException_on_builder_null()
 {
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(null, blobSasUri: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), blobSasUri: null));
     Assert.Throws <ArgumentException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), blobSasUri: new Uri("http://test")));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(null, blobUri: null, tokenCredential: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), blobUri: null, tokenCredential: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), blobUri: new Uri("http://www.example.com"), tokenCredential: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(null, blobUri: null, sharedKeyCredential: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), blobUri: null, sharedKeyCredential: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), blobUri: new Uri("http://www.example.com"), sharedKeyCredential: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(null, connectionString: null, containerName: null, blobName: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), connectionString: "test", containerName: null, blobName: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), connectionString: "test", containerName: "test", blobName: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(null, blobClient: null));
     Assert.Throws <ArgumentNullException>(() => KeyRotationBuilderExtensions.PersistKeysToAzureBlobStorage(new KeyRotationBuilder(), blobClient: null));
 }