Commit bc791b809179dc14fe18c0d04d67b0bd9a2060f0

Authored by Adhidarma Hadiwinoto
1 parent 5144c93433
Exists in master

a little modification on test

Showing 1 changed file with 10 additions and 10 deletions Inline Diff

1 var assert = require("assert"); 1 var assert = require("assert");
2 2
3 3
4 describe('aaa', function() { 4 describe('aaa', function() {
5 var aaa = require('./aaa'); 5 var aaa = require('sate24/aaa');
6 6
7 describe("#unaliasResponseCode()", function() { 7 describe("#unaliasResponseCode()", function() {
8 it('should return 68', function() { 8 it('should return 68', function() {
9 assert.equal('68', aaa.unaliasResponseCode('01', '01:68')); 9 assert.equal('68', aaa.unaliasResponseCode('01', '01:68'));
10 }); 10 });
11 11
12 it('should return 68', function() { 12 it('should return 68', function() {
13 assert.equal('68', aaa.unaliasResponseCode('68', '01:68')); 13 assert.equal('68', aaa.unaliasResponseCode('68', '01:68'));
14 }); 14 });
15 15
16 it('should return 00', function() { 16 it('should return 00', function() {
17 assert.equal('00', aaa.unaliasResponseCode('00', '01:68')); 17 assert.equal('00', aaa.unaliasResponseCode('00', '01:68'));
18 }); 18 });
19 19
20 it('should return 40', function() { 20 it('should return 40', function() {
21 assert.equal('40', aaa.unaliasResponseCode('40', '')); 21 assert.equal('40', aaa.unaliasResponseCode('40', ''));
22 }); 22 });
23 23
24 it('should return 40', function() { 24 it('should return 40', function() {
25 assert.equal('40', aaa.unaliasResponseCode('40', '')); 25 assert.equal('40', aaa.unaliasResponseCode('40', ''));
26 }); 26 });
27 27
28 it('should return 40', function() { 28 it('should return 40', function() {
29 assert.equal('40', aaa.unaliasResponseCode('40')); 29 assert.equal('40', aaa.unaliasResponseCode('40'));
30 }); 30 });
31 31
32 }); 32 });
33 }); 33 });
34 34
35 describe('aaa', function() { 35 describe('aaa', function() {
36 var partner = require('./httppulsakita'); 36 var partner = require('./httppulsakita');
37 37
38 describe("#parseResult()", function() { 38 describe("#parseResult()", function() {
39 message = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><respon><tanggal>2015/6/16 15:43:35</tanggal><idagen>P0039</idagen><refid>AEE15B32987941D89FFF4BC7EF676C13</refid><produk>PLN20</produk><tujuan>14204279369</tujuan><rc>0000</rc><data> </data><token> </token><pesan>#14836 PLN20 ke:14204279369 SUKSES. SN:3520-2887-6627-6699-4826/TestDummyPanjang6955555/P1/7000VA/32,4. \ 39 message = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><respon><tanggal>2015/6/16 15:43:35</tanggal><idagen>P0039</idagen><refid>AEE15B32987941D89FFF4BC7EF676C13</refid><produk>PLN20</produk><tujuan>14204279369</tujuan><rc>0000</rc><data> </data><token> </token><pesan>#14836 PLN20 ke:14204279369 SUKSES. SN:3520-2887-6627-6699-4826/TestDummyPanjang6955555/P1/7000VA/32,4. \
40 Sisa saldo Rp. 5,000,000 - Rp. 18,700 = Rp. 4,981,300</pesan></respon>'; 40 Sisa saldo Rp. 5,000,000 - Rp. 18,700 = Rp. 4,981,300</pesan></respon>';
41 41
42 data = partner.parseResult(message); 42 data = partner.parseResult(message);
43 console.log(data); 43 console.log(data);
44 44
45 it('should return 2015/6/16 15:43:35', function() { 45 it('should return 2015/6/16 15:43:35', function() {
46 assert.equal('2015/6/16 15:43:35', data.respon.tanggal); 46 assert.equal('2015/6/16 15:43:35', data.respon.tanggal);
47 }); 47 });
48 }); 48 });
49 }); 49 });
50 50