Sha256: e143e8e02ac67deadeb5dfa35c02fbd3064495117536d23028f270eb4c2b54fc

Contents?: true

Size: 1.23 KB

Versions: 2

Compression:

Stored size: 1.23 KB

Contents

require_relative '../test/core_pro_test_base'
require_relative '../lib/corepro/account'

class AbAccountNachaTest #< CoreProTestBase

  def test_create
    a = CorePro::Account.new
    a.customerId = @@nachaCustomerId
    a.tag = "act#{@@timestamp}"
    a.type = 'Client'
    a.category = 'CategoryA'
    a.subCategory = 'CategoryB'
    a.isCloseable = true
    a.name = "Account #{@@timestamp}"
    a.targetAmount = 500
    a.targetDate = '01/01/2030'
    @@nachaAccountId = a.create @@nachaConn, nil

    assert @@nachaAccountId > 0

  end

  def test_list
    accounts = CorePro::Account.list(@@nachaCustomerId, @@nachaConn, nil)
    assert_equal 1, accounts.length, "Listed #{accounts.length} accounts for customerId=#{@@nachaCustomerId}"
  end

  def test_get
    a = CorePro::Account.get(@@nachaCustomerId, @@nachaAccountId, @@nachaConn, nil)
    assert_not_empty a.accountNumber
  end

  def test_update
    a = CorePro::Account.get(@@nachaCustomerId, @@nachaAccountId, @@nachaConn, nil)
    a = CorePro::Account.new
    a.accountId = @@nachaAccountId
    a.customerId = @@nachaCustomerId
    a.name = "Updated account #{@@timestamp}"
    accountId = a.update @@nachaConn, nil
    assert accountId == @@nachaAccountId
  end

  def test_zzz_close

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
corepro-0.0.7 test/ab_account_nacha_test.rb
corepro-0.0.6 test/ab_account_nacha_test.rb