From 9b2e38d7c35c414d6d473af803a67991fdfad822 Mon Sep 17 00:00:00 2001 From: lilleman Date: Fri, 1 May 2015 13:44:43 +0200 Subject: [PATCH] Finalized TLV test case --- test/03_pdu.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/03_pdu.js b/test/03_pdu.js index a220739..ec592f3 100644 --- a/test/03_pdu.js +++ b/test/03_pdu.js @@ -189,9 +189,13 @@ describe('PDU convertion', function() { assert( ! err, 'Error should be negative'); larvitsmpp.utils.pduToObj(pduBuf, function(err, pduObj2) { + var unknownTlvBuf = new Buffer(pduObj2.tlvs['5142'].tagValue, 'hex'); + assert( ! err, 'Error should be negative'); - console.log(pduObj2); + assert(pduObj2.tlvs.receipted_message_id !== undefined, 'TLV receipted_message_id should not be undefined'); + assert(pduObj2.tlvs.receipted_message_id.tagValue === '293f293', 'receipted_message_id should match the given one'); + assert(unknownTlvBuf.toString('ascii') === 'blajfoo', 'Unknown TLV 5142 should have a valid buffer'); done(); });