test/AsciiConverterTest.js   A
last analyzed

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
wmc 8
eloc 17
mnd 0
bc 0
fnc 8
dl 0
loc 30
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 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