Sha256: 254b381d0058f4436e5b9b465b107551c01dee3fd93722c0ef98bfe08ac7dcb3

Contents?: true

Size: 1.69 KB

Versions: 47

Compression:

Stored size: 1.69 KB

Contents

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

# Test class for ExpressRouteCircuitPeering Collection
class TestExpressRouteCircuitPeerings < Minitest::Test
  def setup
    @service = Fog::Network::AzureRM.new(credentials)
    @circuit_peerings = Fog::Network::AzureRM::ExpressRouteCircuitPeerings.new(resource_group: 'fog-test-rg', circuit_name: 'testCircuit', service: @service)
    @network_client = @service.instance_variable_get(:@network_client)
  end

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

  def test_collection_attributes
    assert_respond_to @circuit_peerings, :resource_group
    assert_respond_to @circuit_peerings, :circuit_name
  end

  def test_all_method_response
    response = [ApiStub::Models::Network::ExpressRouteCircuitPeering.create_express_route_circuit_peering_response(@network_client)]
    @service.stub :list_express_route_circuit_peerings, response do
      assert_instance_of Fog::Network::AzureRM::ExpressRouteCircuitPeerings, @circuit_peerings.all
      assert @circuit_peerings.all.size >= 1
      @circuit_peerings.all.each do |circuit_peering|
        assert_instance_of Fog::Network::AzureRM::ExpressRouteCircuitPeering, circuit_peering
      end
    end
  end

  def test_get_method_response
    response = ApiStub::Models::Network::ExpressRouteCircuitPeering.create_express_route_circuit_peering_response(@network_client)
    @service.stub :get_express_route_circuit_peering, response do
      assert_instance_of Fog::Network::AzureRM::ExpressRouteCircuitPeering, @circuit_peerings.get('HaiderRG', 'AzurePrivatePeering', 'testCircuit')
    end
  end
end

Version data entries

47 entries across 47 versions & 4 rubygems

Version Path
fog-azure-rm-0.2.5 test/models/network/test_express_route_circuit_peerings.rb
fog-azure-rm-0.2.4 test/models/network/test_express_route_circuit_peerings.rb
fog-azure-rm-0.2.3 test/models/network/test_express_route_circuit_peerings.rb
fog-azure-rm-0.2.2 test/models/network/test_express_route_circuit_peerings.rb
fog-azure-rm-0.2.1 test/models/network/test_express_route_circuit_peerings.rb
fog-azure-rm-0.2.0 test/models/network/test_express_route_circuit_peerings.rb
fog-azure-rm-0.1.2 test/models/network/test_express_route_circuit_peerings.rb