Sha256: 9db00975692da75c0c9ce598738c8ebbf531f6b5adb9ddf5dde27b01986ed117

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

Contents

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

# Storage Container Class
class TestCreateContaienr < Minitest::Test
  # This class posesses the test cases for the requests of creating storage containers.
  def setup
    @service = Fog::Storage::AzureRM.new(storage_account_credentials)
    @blob_client = @service.instance_variable_get(:@blob_client)
    @storage_container_object = ApiStub::Requests::Storage::Container.create_container
  end

  def test_create_container_with_service_success
    @blob_client.stub :create_container, @storage_container_object do
      assert @service.create_container('testcontainer1')
    end
  end

  def test_create_container_with_internal_client_success
    @blob_client.stub :create_container, @storage_container_object do
      assert @blob_client.create_container('testcontainer1')
    end
  end

  def test_create_container_with_service_exception
    assert_raises(URI::InvalidURIError) { @service.create_container('testcontainer1#@#@') }
  end

  def test_create_container_with_internal_client_exception
    assert_raises(URI::InvalidURIError) { @blob_client.create_container('testcontainer1#@#@') }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.6 test/requests/storage/test_create_container.rb
fog-azure-rm-0.0.5 test/requests/storage/test_create_container.rb
fog-azure-rm-0.0.4 test/requests/storage/test_create_container.rb