Completed
Push — master ( b8a2ae...421529 )
by Samson
02:36
created

test/GeezConverterTest.js   A

Complexity

Total Complexity 8
Complexity/F 1

Size

Lines of Code 30
Function Count 8

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 0
eloc 17
nc 1
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 8
mnd 0
bc 8
fnc 8
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A GeezConverterTest.js ➔ ??? 0 20 1
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