Passed
Push — develop ( f0c08b...9e3bd7 )
by Endre
03:40
created

Presenter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 17
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A present 0 8 1
1
import {ILanguageSetup} from '../../../Language/ChangeLanguageSetup';
2
import Translator from '../../../Language/Translator';
3
import {IObserver} from '../../../Observer/Observer';
4
import TopBarPresenter from '../TopBar/Presenter.js';
5
import Model from './Model';
6
7
export default class Presenter {
8
  languageSetupObserver: IObserver<ILanguageSetup>;
9
  topAppBarPresenter: TopBarPresenter;
10
11
  constructor(languageSetupObserver: IObserver<ILanguageSetup>, topAppBarPresenter: TopBarPresenter) {
12 2
    this.languageSetupObserver = languageSetupObserver;
13 2
    this.topAppBarPresenter = topAppBarPresenter;
14
  }
15
16
  present(data: string) {
17 1
    const viewModel: Model = new Model();
18 1
    const translator: Translator = this.languageSetupObserver.value.translator;
19 1
    viewModel.text = data + translator.translate('Application.Test');
20 1
    viewModel.topAppBar = this.topAppBarPresenter.present();
21
22 1
    return viewModel;
23
  }
24
}