Sha256: a3bc528ce73b5e17d9947cf9e5e25706dd4589fb2687e5efafa124992234f155

Contents?: true

Size: 1.23 KB

Versions: 46

Compression:

Stored size: 1.23 KB

Contents

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

# Test class for Database Collection
class TestDatabases < Minitest::Test
  def setup
    @service = Fog::Sql::AzureRM.new(credentials)
    @databases = databases(@service)
    @database_client = @service.instance_variable_get(:@sql_mgmt_client)
    @database_response = ApiStub::Models::Sql::SqlDatabase.create_database(@database_client)
  end

  def test_collection_methods
    methods = [
      :all,
      :get
    ]
    methods.each do |method|
      assert_respond_to @databases, method
    end
  end

  def test_collection_attributes
    assert_respond_to @databases, :resource_group
    assert_respond_to @databases, :server_name
  end

  def test_all_method_response
    @service.stub :list_databases, [@database_response] do
      assert_instance_of Fog::Sql::AzureRM::SqlDatabases, @databases.all
      assert @databases.all.size >= 1
      @databases.all.each do |s|
        assert_instance_of Fog::Sql::AzureRM::SqlDatabase, s
      end
    end
  end

  def test_get_method_response
    @service.stub :get_database, @database_response do
      assert_instance_of Fog::Sql::AzureRM::SqlDatabase, @databases.get('fog-test-rg', 'fog-test-server-name', 'fog-test-database-name')
    end
  end
end

Version data entries

46 entries across 46 versions & 4 rubygems

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