Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Chechel committed Oct 3, 2014
1 parent d38be33 commit 112ca21
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/apdu_request_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ def test_from_hex_string_method
request_helper(request)
end

def test_to_s_method
apdu = "0102030405DEADBEEFAA06"
request = APDU::Request.from_hex_string(apdu)
assert_equal "\x01\x02\x03\x04\x05\xDE\xAD\xBE\xEF\xAA\x06", request.build
end

def test_build_method
apdu = "0102030405DEADBEEFAA06"
request = APDU::Request.from_hex_string(apdu)
assert_equal "0102030405DEADBEEFAA06", request.to_s
end

def request_helper(request)
assert_equal 1, request.cla
assert_equal 2, request.ins
Expand All @@ -48,4 +60,5 @@ def request_helper(request)
assert_equal 6, request.le
assert_equal "\xDE\xAD\xBE\xEF\xAA", request.data
end

end

0 comments on commit 112ca21

Please sign in to comment.