diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-02-04 03:12:56 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-02-04 03:12:56 +0800 |
commit | ddc17196da36c1ad660b70f33f8b4eaaccdbdda8 (patch) | |
tree | 09a3246661cbf776f9250bc051569e011ea44d74 /test/utils.extractDisplayName.js | |
parent | fdcc1af4e22c65d4b920b6143918d54c66ab0d08 (diff) | |
download | dexon-ddc17196da36c1ad660b70f33f8b4eaaccdbdda8.tar dexon-ddc17196da36c1ad660b70f33f8b4eaaccdbdda8.tar.gz dexon-ddc17196da36c1ad660b70f33f8b4eaaccdbdda8.tar.bz2 dexon-ddc17196da36c1ad660b70f33f8b4eaaccdbdda8.tar.lz dexon-ddc17196da36c1ad660b70f33f8b4eaaccdbdda8.tar.xz dexon-ddc17196da36c1ad660b70f33f8b4eaaccdbdda8.tar.zst dexon-ddc17196da36c1ad660b70f33f8b4eaaccdbdda8.zip |
tests && fixes for utils methods
Diffstat (limited to 'test/utils.extractDisplayName.js')
-rw-r--r-- | test/utils.extractDisplayName.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/utils.extractDisplayName.js b/test/utils.extractDisplayName.js new file mode 100644 index 000000000..148653ab2 --- /dev/null +++ b/test/utils.extractDisplayName.js @@ -0,0 +1,42 @@ +var assert = require('assert'); +var utils = require('../lib/utils.js'); + +describe('utils', function () { + describe('extractDisplayName', function () { + it('should extract display name from method with no params', function () { + + // given + var test = 'helloworld()'; + + // when + var displayName = utils.extractDisplayName(test); + + // then + assert.equal(displayName, 'helloworld'); + }); + + it('should extract display name from method with one param' , function () { + + // given + var test = 'helloworld1(int)'; + + // when + var displayName = utils.extractDisplayName(test); + + // then + assert.equal(displayName, 'helloworld1'); + }); + + it('should extract display name from method with two params' , function () { + + // given + var test = 'helloworld2(int,string)'; + + // when + var displayName = utils.extractDisplayName(test); + + // then + assert.equal(displayName, 'helloworld2'); + }); + }); +}); |