Completed
Push — master ( 1fc2ad...b8a2ae )
by Samson
02:50
created

test/AsciiConverterTest.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 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A AsciiConverterTest.js ➔ describe(ꞌAsciiConverterTestꞌ) 0 22 1
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
asciiConverter = new AsciiConverter();
0 ignored issues
show
Bug introduced by
The variable asciiConverter seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.asciiConverter.
Loading history...
8
9
describe('AsciiConverterTest', function () {
10
11
    describe('#test_ascii_converter()', function () {
12
        it('should convert geez number to ascii', function () {
13
            TestCase.geezNumberTestDataProvider().forEach(([$ascii, $geez]) => {
14
                $result = asciiConverter.convert($geez);
0 ignored issues
show
Bug introduced by
The variable $result seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.$result.
Loading history...
15
                assert.equal($ascii, $result);
16
            });
17
        });
18
    });
19
20
    describe('#test_invalid_number_throw_exception()', function () {
21
        it('should throws NotGeezArgumentException', function () {
22
            TestCase.invalidNumberDataProvider().forEach(([$value]) => {
23
                assert.throws(() => {
24
                    asciiConverter.convert($value)
25
                }, NotGeezArgumentException);
26
            });
27
        });
28
    });
29
30
});
31