Sha256: bc29f6a8452e60724e3ec1b944198439dde3f1615fffb5d4868fdb79ac5eebc3

Contents?: true

Size: 1.45 KB

Versions: 2

Compression:

Stored size: 1.45 KB

Contents

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

# Test Class for RecoveryVault Collections
class TestRecoveryVaults < Minitest::Test
  def setup
    @service = Fog::Storage::AzureRM.new(credentials)
    @recovery_vaults = Fog::Storage::AzureRM::RecoveryVaults.new(resource_group: 'fog-test-rg', service: @service)
  end

  def test_collection_methods
    methods = [
      :all,
      :get
    ]
    methods.each do |method|
      assert_respond_to @recovery_vaults, method
    end
  end

  def test_collection_attributes
    attributes = [
      :resource_group,
      :name
    ]
    attributes.each do |attribute|
      assert_respond_to @recovery_vaults, attribute
    end
  end

  def test_all_method_response
    response = [ApiStub::Models::Storage::RecoveryVault.create_method_response]
    @service.stub :list_recovery_vaults, response do
      assert_instance_of Fog::Storage::AzureRM::RecoveryVaults, @recovery_vaults.all
      assert @recovery_vaults.all.size >= 1
      @recovery_vaults.all.each do |recovery_vault|
        assert_instance_of Fog::Storage::AzureRM::RecoveryVault, recovery_vault
      end
    end
  end

  def test_get_method_response
    response = ApiStub::Models::Storage::RecoveryVault.create_method_response
    @service.stub :get_recovery_vault, response do
      assert_instance_of Fog::Storage::AzureRM::RecoveryVault, @recovery_vaults.get('fog-test-rg', 'fog-test-vault')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 test/models/storage/test_recovery_vaults.rb
fog-azure-rm-0.1.0 test/models/storage/test_recovery_vaults.rb