Sha256: 510d0f0fda6a6a265404604f3c7705a29c261b80fd716e161478993924ee7296

Contents?: true

Size: 1.18 KB

Versions: 33

Compression:

Stored size: 1.18 KB

Contents

require File.expand_path '../../test_helper', __dir__

# Test Class for Delete Storage Account Request
class TestDeleteStorageAccount < Minitest::Test
  # This class posesses the test cases for the requests of storage account service.
  def setup
    @azure_credentials = Fog::Storage::AzureRM.new(credentials)
    storage_mgmt_client = @azure_credentials.instance_variable_get(:@storage_mgmt_client)
    @storage_accounts = storage_mgmt_client.storage_accounts
  end

  def test_delete_storage_account_success
    @storage_accounts.stub :delete, nil do
      assert @azure_credentials.delete_storage_account('gateway-RG', 'fog_test_storage_account')
    end
  end

  def test_delete_storage_account_failure
    assert_raises(ArgumentError) { @azure_credentials.delete_storage_account('gateway-RG', 'fog_test_storage_account', 'Hi') }
  end

  def test_delete_storage_account_exception
    raise_exception = proc { fail MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
    @storage_accounts.stub :delete, raise_exception do
      assert_raises(RuntimeError) { @azure_credentials.delete_storage_account('gateway-RG', 'fog_test_storage_account') }
    end
  end
end

Version data entries

33 entries across 33 versions & 4 rubygems

Version Path
fog-azure-rm-0.4.5 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-temp-0.0.5 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-0.4.4 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-0.4.3 test/requests/storage/test_delete_storage_account.rb
far-gem-0.5.1 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-0.4.2 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-0.4.1 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-0.4.0 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-0.3.9 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-0.3.8 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-0.3.7 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-0.3.6 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-0.3.5 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-0.3.4 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-temp-0.0.4 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-temp-0.0.3 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-0.3.3 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-temp-0.0.2 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-temp-0.0.1 test/requests/storage/test_delete_storage_account.rb
fog-azure-rm-0.3.2 test/requests/storage/test_delete_storage_account.rb