Sha256: e9cce073825e69cf615ecbb086d9507c8763e70a820d980f610cbb6e079d4138

Contents?: true

Size: 1.18 KB

Versions: 5

Compression:

Stored size: 1.18 KB

Contents

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

# Test class for List Express Route Circuit Authorization Request
class TestListExpressRouteCircuitAuthorization < Minitest::Test
  def setup
    @service = Fog::Network::AzureRM.new(credentials)
    @network_client = @service.instance_variable_get(:@network_client)
    @circuit_authorization = @network_client.express_route_circuit_authorizations
  end

  def test_list_express_route_circuit_authorizations_success
    mocked_response = [ApiStub::Requests::Network::ExpressRouteCircuitAuthorization.create_express_route_circuit_authorization_response(@network_client)]
    @circuit_authorization.stub :list, mocked_response do
      assert_equal @service.list_express_route_circuit_authorizations('fogRM-rg', 'testCircuit'), mocked_response
    end
  end

  def test_list_express_route_circuit_authorizations_failure
    response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
    @circuit_authorization.stub :list, response do
      assert_raises(RuntimeError) { @service.list_express_route_circuit_authorizations('fogRM-rg', 'testCircuit') }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 test/requests/network/test_list_express_route_circuit_authorizations.rb
fog-azure-rm-0.1.0 test/requests/network/test_list_express_route_circuit_authorizations.rb
fog-azure-rm-0.0.9 test/requests/network/test_list_express_route_circuit_authorizations.rb
fog-azure-rm-0.0.8 test/requests/network/test_list_express_route_circuit_authorizations.rb
fog-azure-rm-0.0.6 test/requests/network/test_list_express_route_circuit_authorizations.rb