converter/src/app/converter/uriencoder.spec.ts

26 lines
736 B
TypeScript

import {URIEncoder} from './uriencoder';
describe('URIEncoder', () => {
let sut: URIEncoder;
beforeEach(() => sut = new URIEncoder());
it('should create an instance', () => {
expect(sut).toBeTruthy();
});
it('should have a display name', () => {
expect(sut.getDisplayname()).toBeTruthy();
});
it('should have the id "uriencode"', () => {
expect(sut.getId()).toEqual('uriencode');
});
it('should encode "http://mänu:ghëim@host:port/hi.there?oh=well#ya" ' +
'to "http://m%C3%A4nu:gh%C3%ABim@host:port/hi.there?oh=well#ya"', () => {
expect(sut.convert('http://mänu:ghëim@host:port/hi.there?oh=well#ya'))
.toEqual('http://m%C3%A4nu:gh%C3%ABim@host:port/hi.there?oh=well#ya');
});
});