Code coverage report for src\components\factory\voyage-factory.js

# all files / src/components/factory/ voyage-factory.js

73.33% Statements 22/30
100% Branches 0/0
33.33% Functions 4/12
73.33% Lines 22/30

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    731×
    1×

    1×

    1×
    17×
    17×
    17×
    17×
    17×

    17×

    1×

    1×

    1×
    8×

    1×

    1×
    8×

    1×

    1×

    1×

    1×

    1×

     (function component(ng) {
      ng.module('components').factory('voyagerFactory', voyagerFactory);

      voyagerFactory.$inject = [];

        /* отвечает за текущий voyage */
        function voyagerFactory() {
            var voyager = {};
            var cancel;
            var save;
            var saveEvent;
            var cancelEvent;

            return {
                get: get,
                registr: reg,
                registrCancel: regCancel,
                registrSave: regSave,
                getCancel: getCancel,
                getSave: getSave,
                registrSaveEvent: regSaveEvent,
                getSaveEvent: getSaveEvent,
                registrCancelEvent: regCancelEvent,
                getCancelEvent: getCancelEvent
            };

            /* регистрирует текущий voyage перед открытием */
            function reg(voyager) {
                this.voyager = voyager;
            }

            /* возвращает текущий voyage */
            function get() {
                return this.voyager;
            }

            /* регистрация функции отмены изменений */
            function regCancel(cancel) {
                this.cancel = cancel;
            }

            function getCancel() {
                this.cancel();
            }

            /* регистрация функции сохранения изменений */
            function regSave(save) {
                this.save = save;
            }

            function getSave() {
                this.save();
            }

            function regSaveEvent(save) {
                this.saveEvent = save;
            }

            function getSaveEvent() {
                this.saveEvent();
            }

            function regCancelEvent(cancel) {
                this.cancelEvent = cancel;
            }

            function getCancelEvent() {
                this.cancelEvent();
            }

      }
    })(angular);