Total Complexity | 8 |
Complexity/F | 1 |
Lines of Code | 30 |
Function Count | 8 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | const assert = require('assert'); |
||
2 | |||
3 | const TestCase = require('./TestCase'); |
||
4 | const AsciiConverter = require('../src/Converter/AsciiConverter'); |
||
5 | const NotGeezArgumentException = require('../src/Exception/NotGeezArgumentException'); |
||
6 | |||
7 | const asciiConverter = new AsciiConverter(); |
||
8 | |||
9 | /* global describe, it */ |
||
10 | |||
11 | describe('AsciiConverterTest', () => { |
||
12 | describe('#test_ascii_converter()', () => { |
||
13 | it('should convert geez number to ascii', () => { |
||
14 | TestCase.geezNumberTestDataProvider().forEach(([$ascii, $geez]) => { |
||
15 | const $result = asciiConverter.convert($geez); |
||
16 | assert.equal($ascii, $result); |
||
17 | }); |
||
18 | }); |
||
19 | }); |
||
20 | |||
21 | describe('#test_invalid_number_throw_exception()', () => { |
||
22 | it('should throws NotGeezArgumentException', () => { |
||
23 | TestCase.invalidNumberDataProvider().forEach(([$value]) => { |
||
24 | assert.throws(() => { |
||
25 | asciiConverter.convert($value); |
||
26 | }, NotGeezArgumentException); |
||
27 | }); |
||
28 | }); |
||
29 | }); |
||
30 | }); |
||
31 |