Fix Base64{De,En}coder filenames and add tests.

This commit is contained in:
Manuel Friedli 2018-08-31 23:22:15 +02:00
parent 9e11ba9335
commit 1b060644c3
6 changed files with 30 additions and 3 deletions

View file

@ -5,6 +5,7 @@ import {InputComponentManagerService} from './input-component-manager.service';
import {Step} from './step'; import {Step} from './step';
import {ConverterRegistryService} from './converter-registry.service'; import {ConverterRegistryService} from './converter-registry.service';
import {Converter} from './converter/converter'; import {Converter} from './converter/converter';
import {VersionComponent} from './version/version.component';
describe('AppComponent', () => { describe('AppComponent', () => {
let sut: AppComponent; let sut: AppComponent;
@ -30,7 +31,7 @@ describe('AppComponent', () => {
beforeEach(async(() => { beforeEach(async(() => {
/*return */ /*return */
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [AppComponent], declarations: [AppComponent, VersionComponent],
imports: [FormsModule], imports: [FormsModule],
providers: [ providers: [
{provide: InputComponentManagerService, useValue: inputComponentManagerServiceStub}, {provide: InputComponentManagerService, useValue: inputComponentManagerServiceStub},

View file

@ -1,5 +1,5 @@
import {Base64Decoder} from './converter/base64decoder'; import {Base64Decoder} from './converter/base64-decoder';
import {Base64Encoder} from './converter/base64encoder'; import {Base64Encoder} from './converter/base64-encoder';
import {BinToDecConverter} from './converter/bintodecconverter'; import {BinToDecConverter} from './converter/bintodecconverter';
import {Converter} from './converter/converter'; import {Converter} from './converter/converter';
import {DecToBinConverter} from './converter/dectobinconverter'; import {DecToBinConverter} from './converter/dectobinconverter';

View file

@ -0,0 +1,13 @@
import {Base64Decoder} from './base64-decoder';
describe('Base64Decoder', () => {
it('should create an instance', () => {
expect(new Base64Decoder()).toBeTruthy();
});
it('should have the id "base64decode"', () => {
expect(new Base64Decoder().getId()).toEqual('base64decode');
});
it('should decode "SGVsbG8sIFdvcmxkIQ==" to "Hello, World!"', () => {
expect(new Base64Decoder().convert('SGVsbG8sIFdvcmxkIQ==')).toEqual('Hello, World!');
});
});

View file

@ -0,0 +1,13 @@
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=');
});
});