Sha256: ba4889b3b404129bb34d1b520a41c374a195b4a8f4ba9a7e3b22faaec2c29b65

Contents?: true

Size: 1.32 KB

Versions: 28

Compression:

Stored size: 1.32 KB

Contents

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

# Test class for LoadBalancer Model
class TestLoadBalancer < Minitest::Test
  def setup
    @service = Fog::Network::AzureRM.new(credentials)
    @load_balancer = load_balancer(@service)
    network_client = @service.instance_variable_get(:@network_client)
    @response = ApiStub::Models::Network::LoadBalancer.create_load_balancer_response(network_client)
  end

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

  def test_model_attributes
    attributes = [
      :name,
      :id,
      :location,
      :resource_group,
      :frontend_ip_configurations,
      :backend_address_pool_names,
      :load_balancing_rules,
      :probes,
      :inbound_nat_rules,
      :inbound_nat_pools,
      :tags
    ]
    attributes.each do |attribute|
      assert_respond_to @load_balancer, attribute
    end
  end

  def test_save_method_response
    @service.stub :create_load_balancer, @response do
      assert_instance_of Fog::Network::AzureRM::LoadBalancer, @load_balancer.save
    end
  end

  def test_destroy_method_response
    @service.stub :delete_load_balancer, true do
      assert @load_balancer.destroy
    end
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

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