Sha256: 693758a6e52196ce14da3ad2b6ee957ce1504c0ecf0b88c83df5681b0f3ff752

Contents?: true

Size: 1.65 KB

Versions: 47

Compression:

Stored size: 1.65 KB

Contents

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

# Test class for VirtualNetworkGatewayConnection Model
class TestVirtualNetworkGatewayConnection < Minitest::Test
  def setup
    @service = Fog::Network::AzureRM.new(credentials)
    @gateway_connection = virtual_network_gateway_connection(@service)
    @network_client = @service.instance_variable_get(:@network_client)
  end

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

  def test_model_attributes
    attributes = [
      :name,
      :id,
      :location,
      :resource_group,
      :tags,
      :virtual_network_gateway1,
      :virtual_network_gateway2,
      :local_network_gateway2,
      :enable_bgp,
      :connection_type,
      :authorization_key,
      :routing_weight,
      :shared_key,
      :egress_bytes_transferred,
      :ingress_bytes_transferred,
      :peer,
      :provisioning_state,
      :connection_status
    ]
    attributes.each do |attribute|
      assert_respond_to @gateway_connection, attribute
    end
  end

  def test_save_method_response
    connection_response = ApiStub::Models::Network::VirtualNetworkGatewayConnection.create_virtual_network_gateway_connection_response(@network_client)
    @service.stub :create_or_update_virtual_network_gateway_connection, connection_response do
      assert_instance_of Fog::Network::AzureRM::VirtualNetworkGatewayConnection, @gateway_connection.save
    end
  end

  def test_destroy_method_response
    @service.stub :delete_virtual_network_gateway_connection, true do
      assert @gateway_connection.destroy
    end
  end
end

Version data entries

47 entries across 47 versions & 4 rubygems

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