Sha256: 2b1ebd055704d7936d23611656cfff46e1ba3151aed9084837bd33ba37cd30f5

Contents?: true

Size: 784 Bytes

Versions: 36

Compression:

Stored size: 784 Bytes

Contents

require 'test_helper'

class CVVResultTest < Test::Unit::TestCase
  def test_nil_data
    result = CVVResult.new(nil)
    assert_nil result.code
    assert_nil result.message
  end
  
  def test_blank_data
    result = CVVResult.new('')
    assert_nil result.code
    assert_nil result.message
  end
  
  def test_successful_match
    result = CVVResult.new('M')
    assert_equal 'M', result.code
    assert_equal CVVResult.messages['M'], result.message
  end
  
  def test_failed_match
    result = CVVResult.new('N')
    assert_equal 'N', result.code
    assert_equal CVVResult.messages['N'], result.message
  end
  
  def test_to_hash
    result = CVVResult.new('M').to_hash
    assert_equal 'M', result['code']
    assert_equal CVVResult.messages['M'], result['message']
  end
end

Version data entries

36 entries across 36 versions & 11 rubygems

Version Path
johnideal-activemerchant-1.4.10 test/unit/cvv_result_test.rb
johnideal-activemerchant-1.4.11 test/unit/cvv_result_test.rb
johnideal-activemerchant-1.4.4 test/unit/cvv_result_test.rb
johnideal-activemerchant-1.4.5 test/unit/cvv_result_test.rb
johnideal-activemerchant-1.4.6 test/unit/cvv_result_test.rb
johnideal-activemerchant-1.4.7 test/unit/cvv_result_test.rb
johnideal-activemerchant-1.4.8 test/unit/cvv_result_test.rb
mattbauer-activemerchant-1.4.2 test/unit/cvv_result_test.rb
tomriley-active_merchant-1.4.2.3 test/unit/cvv_result_test.rb
tomriley-active_merchant-1.4.2.4 test/unit/cvv_result_test.rb
tomriley-active_merchant-1.4.2.5 test/unit/cvv_result_test.rb
tomriley-active_merchant-1.4.2.6 test/unit/cvv_result_test.rb
tomriley-active_merchant-1.4.2.7 test/unit/cvv_result_test.rb
tomriley-active_merchant-1.4.2.8 test/unit/cvv_result_test.rb
tomriley-tomriley-active_merchant-1.4.2.4 test/unit/cvv_result_test.rb
goldstar-activemerchant-1.4.2.7 test/unit/cvv_result_test.rb
goldstar-activemerchant-1.4.2.6 test/unit/cvv_result_test.rb
tomriley-active_merchant-1.4.2.11 test/unit/cvv_result_test.rb
tomriley-active_merchant-1.4.2.10 test/unit/cvv_result_test.rb
smulube-activemerchant-1.5.1.4 test/unit/cvv_result_test.rb