Sha256: bee5249bd85dbda89e5b90c11358ff1b00caf691c165c5848f46492410c1cc0e

Contents?: true

Size: 1.01 KB

Versions: 14

Compression:

Stored size: 1.01 KB

Contents

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

# Test class for Delete Network Interface Request
class TestDeleteNetworkInterface < Minitest::Test
  def setup
    @service = Fog::Network::AzureRM.new(credentials)
    network_client = @service.instance_variable_get(:@network_client)
    @network_interfaces = network_client.network_interfaces
  end

  def test_delete_network_interface_success
    response = ApiStub::Requests::Network::NetworkInterface.delete_network_interface_response
    @network_interfaces.stub :delete, @promise do
      assert @service.delete_network_interface('fog-test-rg', 'fog-test-network-interface'), response
    end
  end

  def test_delete_network_interface_failure
    response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
    @network_interfaces.stub :delete, response do
      assert_raises(MsRestAzure::AzureOperationError) { @service.delete_network_interface('fog-test-rg', 'fog-test-network-interface') }
    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_delete_network_interface.rb
fog-azure-rm-0.5.3 test/requests/network/test_delete_network_interface.rb
fog-azure-rm-0.5.2 test/requests/network/test_delete_network_interface.rb
far-gem-0.5.6 test/requests/network/test_delete_network_interface.rb
fog-azure-rm-0.5.1 test/requests/network/test_delete_network_interface.rb
far-gem-0.5.5 test/requests/network/test_delete_network_interface.rb
fog-azure-rm-0.5.0 test/requests/network/test_delete_network_interface.rb
far-gem-0.5.4 test/requests/network/test_delete_network_interface.rb
far-gem-0.5.3 test/requests/network/test_delete_network_interface.rb
fog-azure-rm-0.4.9 test/requests/network/test_delete_network_interface.rb
far-gem-0.5.2 test/requests/network/test_delete_network_interface.rb
fog-azure-rm-0.4.8 test/requests/network/test_delete_network_interface.rb
fog-azure-rm-0.4.7 test/requests/network/test_delete_network_interface.rb
fog-azure-rm-0.4.6 test/requests/network/test_delete_network_interface.rb