Sha256: 827d3c9b95b5006fa135cb3266004e6d553f00896df23129afce543ee0c43efc

Contents?: true

Size: 1.42 KB

Versions: 1

Compression:

Stored size: 1.42 KB

Contents

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

# Test class for Traffic Manager End Point Model
class TestTrafficManagerEndPoint < Minitest::Test
  def setup
    @service = Fog::Network::AzureRM.new(credentials)
    @traffic_manager_end_point = traffic_manager_end_point(@service)
  end

  def test_model_methods
    methods = [
      :save,
      :destroy
    ]
    methods.each do |method|
      assert @traffic_manager_end_point.respond_to? method
    end
  end

  def test_model_attributes
    attributes = [
      :name,
      :traffic_manager_profile_name,
      :id,
      :resource_group,
      :type,
      :target_resource_id,
      :target,
      :endpoint_status,
      :endpoint_monitor_status,
      :weight,
      :priority,
      :endpoint_location,
      :min_child_endpoints
    ]
    attributes.each do |attribute|
      assert @traffic_manager_end_point.respond_to? attribute
    end
  end

  def test_save_method_response
    response = ApiStub::Models::Network::TrafficManagerEndPoint.create_traffic_manager_end_point_response
    @service.stub :create_traffic_manager_endpoint, response do
      assert_instance_of Fog::Network::AzureRM::TrafficManagerEndPoint, @traffic_manager_end_point.save
    end
  end

  def test_destroy_method_response
    @service.stub :delete_traffic_manager_endpoint, true do
      assert @traffic_manager_end_point.destroy
    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_point.rb