Sha256: 8750739f184e31d2cc7e5d7342b17fe45dea3495f0ea21eaab14a769d2e30b8d

Contents?: true

Size: 1003 Bytes

Versions: 14

Compression:

Stored size: 1003 Bytes

Contents

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

# Test class for Set Connection Shared Key Request
class TestSetConnectionSharedKey < Minitest::Test
  def setup
    @service = Fog::Network::AzureRM.new(credentials)
    @network_client = @service.instance_variable_get(:@network_client)
    @gateway_connections = @network_client.virtual_network_gateway_connections
  end

  def test_set_connection_shared_key_success
    @gateway_connections.stub :set_shared_key, nil do
      assert_equal @service.set_connection_shared_key('fog-test-rg', 'fog-test-gateway-connection', 'hello'), true
    end
  end

  def test_set_connection_shared_key_failure
    response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
    @gateway_connections.stub :set_shared_key, response do
      assert_raises(MsRestAzure::AzureOperationError) { @service.set_connection_shared_key('fog-test-rg', 'fog-test-gateway-connection', 'hello') }
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
fog-azure-rm-0.6.0 test/requests/network/test_set_connection_shared_key.rb
fog-azure-rm-0.5.3 test/requests/network/test_set_connection_shared_key.rb
fog-azure-rm-0.5.2 test/requests/network/test_set_connection_shared_key.rb
far-gem-0.5.6 test/requests/network/test_set_connection_shared_key.rb
fog-azure-rm-0.5.1 test/requests/network/test_set_connection_shared_key.rb
far-gem-0.5.5 test/requests/network/test_set_connection_shared_key.rb
fog-azure-rm-0.5.0 test/requests/network/test_set_connection_shared_key.rb
far-gem-0.5.4 test/requests/network/test_set_connection_shared_key.rb
far-gem-0.5.3 test/requests/network/test_set_connection_shared_key.rb
fog-azure-rm-0.4.9 test/requests/network/test_set_connection_shared_key.rb
far-gem-0.5.2 test/requests/network/test_set_connection_shared_key.rb
fog-azure-rm-0.4.8 test/requests/network/test_set_connection_shared_key.rb
fog-azure-rm-0.4.7 test/requests/network/test_set_connection_shared_key.rb
fog-azure-rm-0.4.6 test/requests/network/test_set_connection_shared_key.rb