Sha256: be7470a7c61b9da3617d60cc8c5664f6b75bc142bf53cc0a19bf9d705ad4891a

Contents?: true

Size: 1.71 KB

Versions: 2

Compression:

Stored size: 1.71 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 @gateway_connection.respond_to? 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 @gateway_connection.respond_to? 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

2 entries across 2 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.8 test/models/network/test_virtual_network_gateway_connection.rb
fog-azure-rm-0.0.6 test/models/network/test_virtual_network_gateway_connection.rb