Sha256: 26f07cc6b8661b77db78f1435de5f6b1f0df4c2565a27816808d6576b859e5fa

Contents?: true

Size: 1.6 KB

Versions: 1

Compression:

Stored size: 1.6 KB

Contents

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

# Test class for Traffic Manager End Point Collection
class TestTrafficManagerEndPoints < Minitest::Test
  def setup
    @service = Fog::Network::AzureRM.new(credentials)
    @traffic_manager_end_points = Fog::Network::AzureRM::TrafficManagerEndPoints.new(resource_group: 'fog-test-rg', traffic_manager_profile_name: 'fog-test-profile', service: @service)
    @response = ApiStub::Models::Network::TrafficManagerProfile.traffic_manager_profile_response
  end

  def test_collection_methods
    methods = [
      :all,
      :get
    ]
    methods.each do |method|
      assert @traffic_manager_end_points.respond_to? method
    end
  end

  def test_collection_attributes
    assert @traffic_manager_end_points.respond_to? :resource_group
    assert @traffic_manager_end_points.respond_to? :traffic_manager_profile_name
  end

  def test_all_method_response
    @service.stub :get_traffic_manager_profile, @response do
      assert_instance_of Fog::Network::AzureRM::TrafficManagerEndPoints, @traffic_manager_end_points.all
      assert @traffic_manager_end_points.all.size >= 1
      @traffic_manager_end_points.all.each do |endpoint|
        assert_instance_of Fog::Network::AzureRM::TrafficManagerEndPoint, endpoint
      end
    end
  end

  def test_get_method_response
    @service.stub :get_traffic_manager_profile, @response do
      assert_instance_of Fog::Network::AzureRM::TrafficManagerEndPoint, @traffic_manager_end_points.get('endpoint-name1')
      assert @traffic_manager_end_points.get('wrong-name').nil?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.4 test/models/network/test_traffic_manager_end_points.rb