summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-06-17 19:21:34 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-06-17 19:21:34 +0200
commitde471382a40d2ec8201fec11f37490a32e1267a1 (patch)
treeece6979a6085f49e995747a3f4803596a1dcf5b7 /test
parent2008f19ac190ae317924283d9e88b79b9e0c8e85 (diff)
codec: Implement parsing trx bind resp and fix optional parsing
Diffstat (limited to 'test')
-rw-r--r--test/SMPPMessageTest.st18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SMPPMessageTest.st b/test/SMPPMessageTest.st
index f459540..6d40fc2 100644
--- a/test/SMPPMessageTest.st
+++ b/test/SMPPMessageTest.st
@@ -68,6 +68,13 @@ TestCase subclass: SMPPMessageTest [
16r32]
]
+ exampleBindResponse [
+ ^#[16r00 16r00 16r00 16r1D 16r80 16r00 16r00 16r09
+ 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00
+ 16r53 16r4D 16r50 16r50 16r4D 16r41 16r50 16r00
+ 16r02 16r10 16r00 16r01 16r34]
+ ]
+
testReadMessage [
| msg |
msg := SMPPMessage readFrom: self examplePdu readStream.
@@ -141,4 +148,15 @@ TestCase subclass: SMPPMessageTest [
res := msg toMessage asByteArray.
self assert: res equals: self exampleSubmitSM.
]
+
+ testBindResponse [
+ | msg res |
+ msg := SMPPMessage readFrom: self exampleBindResponse readStream.
+ self assert: msg body class equals: SMPPBindTransceiverResponse.
+ self assert: msg body systemId equals: 'SMPPMAP'.
+
+ "Do round trip test"
+ res := msg toMessage asByteArray.
+ self assert: res equals: self exampleBindResponse.
+ ]
]