Sha256: 71b371e0ac3b882883d7195bda51ece4b77e20c22ed242a01c2393efdc1a06d8

Contents?: true

Size: 1.44 KB

Versions: 2

Compression:

Stored size: 1.44 KB

Contents

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

class AdCustomerBeneficiaryTest < CoreProTestBase

  def test_create
    cb = CorePro::CustomerBeneficiary.new
    cb.customerId = @@exampleCustomerId
    cb.firstName = 'Freddie'
    cb.lastName = "Mercury Ruby #{@@timestamp}"
    cb.birthDate = '1969-05-05T00:00:00.000+00:00'
    cb.taxId = '123412349'
    @@exampleCustomerBeneficiaryId = cb.create @@exampleConn, nil
    assert @@exampleCustomerBeneficiaryId > 0
  end

  def test_get
    cb = CorePro::CustomerBeneficiary.get @@exampleCustomerId, @@exampleCustomerBeneficiaryId, @@exampleConn, nil
    assert_instance_of CorePro::CustomerBeneficiary, cb
  end

  def test_list
    cbs = CorePro::CustomerBeneficiary.list @@exampleCustomerId, @@exampleConn, nil
    assert cbs.length > 0
  end

  def test_update
    cb = CorePro::CustomerBeneficiary.new
    cb.customerId = @@exampleCustomerId
    cb.customerBeneficiaryId = @@exampleCustomerBeneficiaryId
    cb.firstName = "Freddie #{@@timestamp}"
    cbid = cb.update @@exampleConn, nil
    assert_equal @@exampleCustomerBeneficiaryId, cbid
  end

  def test_zzz_deactivate
    cb = CorePro::CustomerBeneficiary.new
    cb.customerId = @@exampleCustomerId
    cb.customerBeneficiaryId = @@exampleCustomerBeneficiaryId
    cbid = cb.deactivate @@exampleConn, nil
    assert_equal @@exampleCustomerBeneficiaryId, cbid
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
corepro-1.0.1 test/ad_customer_beneficiary_test.rb
corepro-1.0.0 test/ad_customer_beneficiary_test.rb