Sha256: c06971887f0f7f611026dd9b3436be7dd10cc4fd7a00d14ad34832be5a7a0ce7

Contents?: true

Size: 959 Bytes

Versions: 6

Compression:

Stored size: 959 Bytes

Contents

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

# Test class for Delete Network Security Group
class TestDeleteNetworkSecurityGroup < Minitest::Test
  def setup
    @service = Fog::Network::AzureRM.new(credentials)
    client = @service.instance_variable_get(:@network_client)
    @network_security_groups = client.network_security_groups
  end

  def test_delete_network_security_group_success
    @network_security_groups.stub :delete, true do
      assert_equal @service.delete_network_security_group('fog-test-rg', 'fog-test-nsg'), true
    end
  end

  def test_delete_network_security_group_failure
    response = proc { raise MsRestAzure::AzureOperationError.new(nil, nil, 'error' => { 'message' => 'mocked exception' }) }
    @network_security_groups.stub :delete, response do
      assert_raises RuntimeError do
        @service.delete_network_security_group('fog-test-rg', 'fog-test-nsg')
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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