Sha256: 250ce49c201459eb9cf631eb704cff06caa9eb713b94701290c0716945b90c2f

Contents?: true

Size: 1.4 KB

Versions: 19

Compression:

Stored size: 1.4 KB

Contents

require 'helper'
require 'mws/recommendations/client'

class TestMWSRecommendationsClient < MiniTest::Test
  def setup
    @client = MWS::Recommendations::Client.new
  end

  def test_gets_last_updated_time_for_recommendations
    operation = {
      'Action' => 'GetLastUpdatedTimeForRecommendations',
      'MarketplaceId' => '1'
    }

    @client.stub(:run, nil) do
      @client.get_last_updated_time_for_recommendations('1')
    end

    assert_equal operation, @client.operation
  end

  def test_lists_recommendations
    operation = {
      'Action' => 'ListRecommendations',
      'CategoryQueryList.CategoryQuery.1.FilterOptions.FilterOption.1.Foo' => '1',
      'MarketplaceId' => '123'
    }

    @client.primary_marketplace_id = '123'
    @client.stub(:run, nil) do
      @client.list_recommendations(category_query_list: [{ 'Foo' => '1' }])
    end

    assert_equal operation, @client.operation
  end

  def test_lists_recommendations_by_next_token
    operation = {
      'Action' => 'ListRecommendationsByNextToken',
      'NextToken' => '1'
    }

    @client.stub(:run, nil) do
      @client.list_recommendations_by_next_token('1')
    end

    assert_equal operation, @client.operation
  end

  def test_gets_service_status
    operation = {
      'Action' => 'GetServiceStatus'
    }

    @client.stub(:run, nil) do
      @client.get_service_status
    end

    assert_equal operation, @client.operation
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
peddler-1.6.3 test/unit/mws/test_recommendations_client.rb
peddler-1.6.2 test/unit/mws/test_recommendations_client.rb
peddler-1.6.1 test/unit/mws/test_recommendations_client.rb
peddler-1.6.0 test/unit/mws/test_recommendations_client.rb
peddler-1.5.0 test/unit/mws/test_recommendations_client.rb
peddler-1.4.1 test/unit/mws/test_recommendations_client.rb
peddler-1.4.0 test/unit/mws/test_recommendations_client.rb
peddler-1.3.0 test/unit/mws/test_recommendations_client.rb
peddler-1.2.0 test/unit/mws/test_recommendations_client.rb
peddler-1.1.1 test/unit/mws/test_recommendations_client.rb
peddler-1.1.0 test/unit/mws/test_recommendations_client.rb
peddler-1.0.2 test/unit/mws/test_recommendations_client.rb
peddler-1.0.1 test/unit/mws/test_recommendations_client.rb
peddler-1.0.0 test/unit/mws/test_recommendations_client.rb
peddler-0.19.0 test/unit/mws/test_recommendations_client.rb
peddler-0.18.0 test/unit/mws/test_recommendations_client.rb
peddler-0.17.1 test/unit/mws/test_recommendations_client.rb
peddler-0.17.0 test/unit/mws/test_recommendations_client.rb
peddler-0.16.0 test/unit/mws/test_recommendations_client.rb