Sha256: 7a45669eef94f775353dcea59460eb5be75d305e8b5d70377a36fa8452866dea

Contents?: true

Size: 1.55 KB

Versions: 15

Compression:

Stored size: 1.55 KB

Contents

require 'helper'
require 'mws/finances/client'

class TestMWSFinancesClient < MiniTest::Test
  def setup
    @client = MWS::Finances::Client.new
  end

  def test_lists_financial_event_groups
    operation = {
      'Action' => 'ListFinancialEventGroups',
      'FinancialEventGroupStartedAfter' => '2015-01-01'
    }

    @client.stub(:run, nil) do
      @client.list_financial_event_groups('2015-01-01')
    end

    assert_equal operation, @client.operation
  end

  def test_lists_financial_event_groups_by_next_token
    operation = {
      'Action' => 'ListFinancialEventGroupsByNextToken',
      'NextToken' => '1'
    }

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

    assert_equal operation, @client.operation
  end

  def test_lists_financial_events
    operation = {
      'Action' => 'ListFinancialEvents',
      'AmazonOrderId' => '123'
    }

    @client.stub(:run, nil) do
      @client.list_financial_events(amazon_order_id: '123')
    end

    assert_equal operation, @client.operation
  end

  def test_lists_financial_events_by_next_token
    operation = {
      'Action' => 'ListFinancialEventsByNextToken',
      'NextToken' => '1'
    }

    @client.stub(:run, nil) do
      @client.list_financial_events_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

15 entries across 15 versions & 1 rubygems

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