Sha256: 5bd1851d7e484c789bfc3c24b84bcff14cfdfe9090dfc1d5314cdc1ebd410069

Contents?: true

Size: 1.29 KB

Versions: 47

Compression:

Stored size: 1.29 KB

Contents

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

# Test class for ExpressRouteCircuit Model
class TestExpressRouteCircuit < Minitest::Test
  def setup
    @service = Fog::Network::AzureRM.new(credentials)
    @circuit = express_route_circuit(@service)
    @network_client = @service.instance_variable_get(:@network_client)
  end

  def test_model_methods
    methods = [
      :save,
      :destroy
    ]
    methods.each do |method|
      assert_respond_to @circuit, method
    end
  end

  def test_model_attributes
    attributes = [
      :resource_group,
      :name,
      :location,
      :tags,
      :sku_name,
      :sku_tier,
      :sku_family,
      :service_provider_name,
      :peering_location,
      :bandwidth_in_mbps,
      :peerings
    ]
    attributes.each do |attribute|
      assert_respond_to @circuit, attribute
    end
  end

  def test_save_method_response
    response = ApiStub::Models::Network::ExpressRouteCircuit.create_express_route_circuit_response(@network_client)
    @service.stub :create_or_update_express_route_circuit, response do
      assert_instance_of Fog::Network::AzureRM::ExpressRouteCircuit, @circuit.save
    end
  end

  def test_destroy_method_response
    @service.stub :delete_express_route_circuit, true do
      assert @circuit.destroy
    end
  end
end

Version data entries

47 entries across 47 versions & 4 rubygems

Version Path
fog-azure-rm-0.2.5 test/models/network/test_express_route_circuit.rb
fog-azure-rm-0.2.4 test/models/network/test_express_route_circuit.rb
fog-azure-rm-0.2.3 test/models/network/test_express_route_circuit.rb
fog-azure-rm-0.2.2 test/models/network/test_express_route_circuit.rb
fog-azure-rm-0.2.1 test/models/network/test_express_route_circuit.rb
fog-azure-rm-0.2.0 test/models/network/test_express_route_circuit.rb
fog-azure-rm-0.1.2 test/models/network/test_express_route_circuit.rb