Fixed DectoBinConverter file name and added tests.
This commit is contained in:
parent
0eb69a3064
commit
83292b14c2
3 changed files with 17 additions and 1 deletions
|
@ -2,7 +2,7 @@ import {Base64Decoder} from './converter/base64-decoder';
|
|||
import {Base64Encoder} from './converter/base64-encoder';
|
||||
import {BinToDecConverter} from './converter/bin-to-dec-converter';
|
||||
import {Converter} from './converter/converter';
|
||||
import {DecToBinConverter} from './converter/dectobinconverter';
|
||||
import {DecToBinConverter} from './converter/dec-to-bin-converter';
|
||||
import {DecToHexConverter} from './converter/dectohexconverter';
|
||||
import {HexToDecConverter} from './converter/hextodecconverter';
|
||||
import {HTMLEntitiesDecoder} from './converter/htmlentitiesdecoder';
|
||||
|
|
16
src/app/converter/dec-to-bin-converter.spec.ts
Normal file
16
src/app/converter/dec-to-bin-converter.spec.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import {DecToBinConverter} from './dec-to-bin-converter';
|
||||
|
||||
describe('DecToBinConverter', () => {
|
||||
it('should create an instance', () => {
|
||||
expect(new DecToBinConverter()).toBeTruthy();
|
||||
});
|
||||
it('should have the id "base64encode"', () => {
|
||||
expect(new DecToBinConverter().getId()).toEqual('dectobin');
|
||||
});
|
||||
it('should convert "22" to "10110"', () => {
|
||||
expect(new DecToBinConverter().convert('22')).toEqual('10110');
|
||||
});
|
||||
it('should raise an exception on invalid input', () => {
|
||||
expect(() => new DecToBinConverter().convert('foo bar')).toThrowError('The input seems not to be a valid integer.');
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue