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 GeezConverter = require('../src/Converter/GeezConverter'); |
||
5 | const NotAnIntegerArgumentException = require('../src/Exception/NotAnIntegerArgumentException'); |
||
6 | |||
7 | const geezConverter = new GeezConverter(); |
||
8 | |||
9 | /* global describe, it */ |
||
10 | |||
11 | describe('GeezConverterTest', () => { |
||
12 | describe('#test_geez_converter()', () => { |
||
13 | it('should convert ascii number to geez', () => { |
||
14 | TestCase.geezNumberTestDataProvider().forEach(([$number, $geez_number]) => { |
||
15 | const $result = geezConverter.convert($number); |
||
16 | assert.equal($geez_number, $result); |
||
17 | }); |
||
18 | }); |
||
19 | }); |
||
20 | |||
21 | describe('#test_invalid_number_throw_exception()', () => { |
||
22 | it('should throws NotAnIntegerArgumentException', () => { |
||
23 | TestCase.invalidNumberDataProvider().forEach(($number) => { |
||
24 | assert.throws(() => { |
||
25 | geezConverter.convert($number); |
||
26 | }, NotAnIntegerArgumentException); |
||
27 | }); |
||
28 | }); |
||
29 | }); |
||
30 | }); |
||
31 |