17 lines
633 B
TypeScript
17 lines
633 B
TypeScript
import {BinToDecConverter} from './bin-to-dec-converter';
|
|
|
|
describe('BinToDecConverter', () => {
|
|
it('should create an instance', () => {
|
|
expect(new BinToDecConverter()).toBeTruthy();
|
|
});
|
|
it('should have the id "base64encode"', () => {
|
|
expect(new BinToDecConverter().getId()).toEqual('bintodec');
|
|
});
|
|
it('should convert "11011" to "27"', () => {
|
|
expect(new BinToDecConverter().convert('11011')).toEqual('27');
|
|
});
|
|
it('should raise an exception on invalid input', () => {
|
|
expect(() => new BinToDecConverter().convert('foo bar')).toThrowError('The input seems not to be a valid binary number.');
|
|
});
|
|
});
|