17 lines
676 B
TypeScript
17 lines
676 B
TypeScript
import {Base64Encoder} from './base64-encoder';
|
|
|
|
describe('Base64Encoder', () => {
|
|
it('should create an instance', () => {
|
|
expect(new Base64Encoder()).toBeTruthy();
|
|
});
|
|
it('should have the id "base64encode"', () => {
|
|
expect(new Base64Encoder().getId()).toEqual('base64encode');
|
|
});
|
|
it('should encode "Oh, guete Tag!" to "T2gsIGd1ZXRlIFRhZyE="', () => {
|
|
expect(new Base64Encoder().convert('Oh, guete Tag!')).toEqual('T2gsIGd1ZXRlIFRhZyE=');
|
|
});
|
|
it('should raise an exception on invalid input', () => {
|
|
expect(() => new Base64Encoder().convert('€')).toThrowError(/Looks like you've got a character outside of the Latin1 range there./);
|
|
});
|
|
});
|