Sha256: e82a7a4ef4aec56bf68b46daf4dc3147dfa70a5b1389bb25ed19111f3a6f4394

Contents?: true

Size: 1.24 KB

Versions: 47

Compression:

Stored size: 1.24 KB

Contents

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

# Test class for Network Security Rule Model
class TestNetworkSecurityRule < Minitest::Test
  def setup
    @service = Fog::Network::AzureRM.new(credentials)
    @client = @service.instance_variable_get(:@network_client)
    @network_security_rule = network_security_rule(@service)
  end

  def test_model_attributes
    attributes = [
      :name,
      :id,
      :resource_group,
      :network_security_group_name,
      :description,
      :protocol,
      :source_port_range,
      :destination_port_range,
      :source_address_prefix,
      :destination_address_prefix,
      :access,
      :priority,
      :direction
    ]
    attributes.each do |attribute|
      assert_respond_to @network_security_rule, attribute
    end
  end

  def test_save_method_response
    response = ApiStub::Models::Network::NetworkSecurityRule.create_network_security_rule_response(@client)
    @service.stub :create_or_update_network_security_rule, response do
      assert_instance_of Fog::Network::AzureRM::NetworkSecurityRule, @network_security_rule.save
    end
  end

  def test_destroy_method_response
    @service.stub :delete_network_security_rule, true do
      assert @network_security_rule.destroy
    end
  end
end

Version data entries

47 entries across 47 versions & 4 rubygems

Version Path
fog-azure-rm-0.6.0 test/models/network/test_network_security_rule.rb
fog-azure-rm-0.5.3 test/models/network/test_network_security_rule.rb
fog-azure-rm-0.5.2 test/models/network/test_network_security_rule.rb
far-gem-0.5.6 test/models/network/test_network_security_rule.rb
fog-azure-rm-0.5.1 test/models/network/test_network_security_rule.rb
far-gem-0.5.5 test/models/network/test_network_security_rule.rb
fog-azure-rm-0.5.0 test/models/network/test_network_security_rule.rb
far-gem-0.5.4 test/models/network/test_network_security_rule.rb
far-gem-0.5.3 test/models/network/test_network_security_rule.rb
fog-azure-rm-0.4.9 test/models/network/test_network_security_rule.rb
far-gem-0.5.2 test/models/network/test_network_security_rule.rb
fog-azure-rm-0.4.8 test/models/network/test_network_security_rule.rb
fog-azure-rm-0.4.7 test/models/network/test_network_security_rule.rb
fog-azure-rm-0.4.6 test/models/network/test_network_security_rule.rb
fog-azure-rm-0.4.5 test/models/network/test_network_security_rule.rb
fog-azure-rm-temp-0.0.5 test/models/network/test_network_security_rule.rb
fog-azure-rm-0.4.4 test/models/network/test_network_security_rule.rb
fog-azure-rm-0.4.3 test/models/network/test_network_security_rule.rb
far-gem-0.5.1 test/models/network/test_network_security_rule.rb
fog-azure-rm-0.4.2 test/models/network/test_network_security_rule.rb