Sha256: 0aa8462c8e4f7a8cc9b9d09b0302b8f30dafd30395642a9c8ff550b6dc92a7ef

Contents?: true

Size: 1.59 KB

Versions: 2

Compression:

Stored size: 1.59 KB

Contents

# frozen_string_literal: true

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

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

  def test_listing_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_listing_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_listing_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_listing_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_getting_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

2 entries across 2 versions & 1 rubygems

Version Path
peddler-2.1.1 test/unit/mws/test_finances_client.rb
peddler-2.1.0 test/unit/mws/test_finances_client.rb