Fixed HTMLEntities{De,En}coder file names and added tests.
This commit is contained in:
parent
8280e0be94
commit
f46604b523
5 changed files with 30 additions and 2 deletions
|
@ -5,8 +5,8 @@ import {Converter} from './converter/converter';
|
||||||
import {DecToBinConverter} from './converter/dec-to-bin-converter';
|
import {DecToBinConverter} from './converter/dec-to-bin-converter';
|
||||||
import {DecToHexConverter} from './converter/dec-to-hex-converter';
|
import {DecToHexConverter} from './converter/dec-to-hex-converter';
|
||||||
import {HexToDecConverter} from './converter/hex-to-dec-converter';
|
import {HexToDecConverter} from './converter/hex-to-dec-converter';
|
||||||
import {HTMLEntitiesDecoder} from './converter/htmlentitiesdecoder';
|
import {HTMLEntitiesDecoder} from './converter/htmlentities-decoder';
|
||||||
import {HTMLEntitiesEncoder} from './converter/htmlentitiesencoder';
|
import {HTMLEntitiesEncoder} from './converter/htmlentities-encoder';
|
||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {NativeLibraryWrapperService} from './native-library-wrapper.service';
|
import {NativeLibraryWrapperService} from './native-library-wrapper.service';
|
||||||
import {PunycodeDecoder} from './converter/punycodedecoder';
|
import {PunycodeDecoder} from './converter/punycodedecoder';
|
||||||
|
|
14
src/app/converter/htmlentities-decoder.spec.ts
Normal file
14
src/app/converter/htmlentities-decoder.spec.ts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import {HTMLEntitiesDecoder} from './htmlentities-decoder';
|
||||||
|
|
||||||
|
describe('HTMLEntitiesDecoder', () => {
|
||||||
|
it('should create an instance', () => {
|
||||||
|
expect(new HTMLEntitiesDecoder()).toBeTruthy();
|
||||||
|
});
|
||||||
|
it('should have the id "decodehtmlentities"', () => {
|
||||||
|
expect(new HTMLEntitiesDecoder().getId()).toEqual('decodehtmlentities');
|
||||||
|
});
|
||||||
|
it('should decode "<span>"Hi" & "Lo"</span>" to "<span>"Hi" & "Lo"</span>"', () => {
|
||||||
|
expect(new HTMLEntitiesDecoder().convert('<span>"Hi" & "Lo"</span>'))
|
||||||
|
.toEqual('<span>"Hi" & "Lo"</span>');
|
||||||
|
});
|
||||||
|
});
|
14
src/app/converter/htmlentities-encoder.spec.ts
Normal file
14
src/app/converter/htmlentities-encoder.spec.ts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import {HTMLEntitiesEncoder} from './htmlentities-encoder';
|
||||||
|
|
||||||
|
describe('HTMLEntitiesEncoder', () => {
|
||||||
|
it('should create an instance', () => {
|
||||||
|
expect(new HTMLEntitiesEncoder()).toBeTruthy();
|
||||||
|
});
|
||||||
|
it('should have the id "encodehtmlentities"', () => {
|
||||||
|
expect(new HTMLEntitiesEncoder().getId()).toEqual('encodehtmlentities');
|
||||||
|
});
|
||||||
|
it('should encode "<span>"Hi" & "Lo"</span>" to "<span>"Hi" & "Lo"</span>"', () => {
|
||||||
|
expect(new HTMLEntitiesEncoder().convert('<span>"Hi" & "Lo"</span>'))
|
||||||
|
.toEqual('<span>"Hi" & "Lo"</span>');
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in a new issue