Sha256: a62a82c20961452574b0ee53ab2e55aee46e626f9789995b4fab5f8d7c010b03

Contents?: true

Size: 1.44 KB

Versions: 28

Compression:

Stored size: 1.44 KB

Contents

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

# Test class for Availability Set Model
class TestAvailabilitySet < Minitest::Test
  def setup
    @service = Fog::Compute::AzureRM.new(credentials)
    @availability_set = availability_set(@service)
    compute_client = @service.instance_variable_get(:@compute_mgmt_client)
    @response = ApiStub::Models::Compute::AvailabilitySet.create_unmanaged_availability_set_response(compute_client)
  end

  def test_model_methods
    methods = [
      :save,
      :destroy
    ]
    methods.each do |method|
      assert_respond_to @availability_set, method
    end
  end

  def test_model_attributes
    attributes = [
      :id,
      :name,
      :type,
      :location,
      :resource_group,
      :platform_update_domain_count,
      :platform_fault_domain_count,
      :use_managed_disk,
      :sku_name,
      :tags
    ]
    attributes.each do |attribute|
      assert_respond_to @availability_set, attribute
    end
  end

  def test_save_method_response
    @service.stub :create_availability_set, @response do
      assert_instance_of Fog::Compute::AzureRM::AvailabilitySet, @availability_set.save
    end
  end

  def test_destroy_method_true_response
    @service.stub :delete_availability_set, true do
      assert @availability_set.destroy
    end
  end

  def test_destroy_method_false_response
    @service.stub :delete_availability_set, false do
      assert !@availability_set.destroy
    end
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
fog-azure-rm-0.6.0 test/models/compute/test_availability_set.rb
fog-azure-rm-0.5.3 test/models/compute/test_availability_set.rb
fog-azure-rm-0.5.2 test/models/compute/test_availability_set.rb
far-gem-0.5.6 test/models/compute/test_availability_set.rb
fog-azure-rm-0.5.1 test/models/compute/test_availability_set.rb
far-gem-0.5.5 test/models/compute/test_availability_set.rb
fog-azure-rm-0.5.0 test/models/compute/test_availability_set.rb
far-gem-0.5.4 test/models/compute/test_availability_set.rb
far-gem-0.5.3 test/models/compute/test_availability_set.rb
fog-azure-rm-0.4.9 test/models/compute/test_availability_set.rb
far-gem-0.5.2 test/models/compute/test_availability_set.rb
fog-azure-rm-0.4.8 test/models/compute/test_availability_set.rb
fog-azure-rm-0.4.7 test/models/compute/test_availability_set.rb
fog-azure-rm-0.4.6 test/models/compute/test_availability_set.rb
fog-azure-rm-0.4.5 test/models/compute/test_availability_set.rb
fog-azure-rm-temp-0.0.5 test/models/compute/test_availability_set.rb
fog-azure-rm-0.4.4 test/models/compute/test_availability_set.rb
fog-azure-rm-0.4.3 test/models/compute/test_availability_set.rb
far-gem-0.5.1 test/models/compute/test_availability_set.rb
fog-azure-rm-0.4.2 test/models/compute/test_availability_set.rb