<commit_before>/*
 * This program is part of the OpenLMIS logistics management information system platform software.
 * Copyright © 2017 VillageReach
 *
 * This program is free software: you can redistribute it and/or modify it under the terms
 * of the GNU Affero General Public License as published by the Free Software Foundation, either
 * version 3 of the License, or (at your option) any later version.
 *  
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 * See the GNU Affero General Public License for more details. You should have received a copy of
 * the GNU Affero General Public License along with this program. If not, see
 * http://www.gnu.org/licenses.  For additional information contact <EMAIL>. 
 */

describe('physicalInventoryService', function() {

    var $rootScope, $httpBackend, physicalInventoryService, stockmanagementUrlFactory, messageService,
        PhysicalInventoryDataBuilder, PhysicalInventoryLineItemDataBuilder, PhysicalInventoryLineItemAdjustmentDataBuilder,
        orderable1, orderable2, lot, stockAdjustment, physicalInventoryLineItems;

    beforeEach(function() {
        module('stock-physical-inventory');
        module('stock-reasons');

        inject(function($injector) {
            $httpBackend = $injector.get('$httpBackend');
            $rootScope = $injector.get('$rootScope');
            stockmanagementUrlFactory = $injector.get('stockmanagementUrlFactory');
            physicalInventoryService = $injector.get('physicalInventoryService');
            messageService = $injector.get('messageService');

            PhysicalInventoryDataBuilder = $injector.get('PhysicalInventoryDataBuilder');
            PhysicalInventoryLineItemDataBuilder = $injector.get('PhysicalInventoryLineItemDataBuilder');
            PhysicalInventoryLineItemAdjustmentDataBuilder = $injector.get('PhysicalInventoryLineItemAdjustmentDataBuilder');
        });

        orderable1 = {
            "id": "c9e65f02-f84f-4ba2-85f7-e2cb6f0989af",
            "productCode": "C1",
            "fullProductName": "Streptococcus Pneumoniae Vaccine II",
            "dispensable": {
                "dispensingUnit": ""
            }
        };

        orderable2 = {
            "id": "2400e410-b8dd-4954-b1c0-80d8a8e785fc",
            "productCode": "C2",
            "fullProductName": "Acetylsalicylic Acid",
            "dispensable": {
                "dispensingUnit": ""
            }
        };

        lot = {
            "lotCode": "L1",
            "expirationDate": "2017-05-02T05:59:51.993Z"
        };

        stockAdjustment = new PhysicalInventoryLineItemAdjustmentDataBuilder().build();

        physicalInventoryLineItems = [<commit_msg>OLMIS-3295: Used Orderable and Lot DataBuilders<commit_after>/*
 * This program is part of the OpenLMIS logistics management information system platform software.
 * Copyright © 2017 VillageReach
 *
 * This program is free software: you can redistribute it and/or modify it under the terms
 * of the GNU Affero General Public License as published by the Free Software Foundation, either
 * version 3 of the License, or (at your option) any later version.
 *  
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 * See the GNU Affero General Public License for more details. You should have received a copy of
 * the GNU Affero General Public License along with this program. If not, see
 * http://www.gnu.org/licenses.  For additional information contact <EMAIL>. 
 */

describe('physicalInventoryService', function() {

    var $rootScope, $httpBackend, physicalInventoryService, stockmanagementUrlFactory, messageService,
        PhysicalInventoryDataBuilder, PhysicalInventoryLineItemDataBuilder, PhysicalInventoryLineItemAdjustmentDataBuilder,
        OrderableDataBuilder, LotDataBuilder, orderable1, orderable2, lot, stockAdjustment, physicalInventoryLineItems;

    beforeEach(function() {
        module('stock-physical-inventory');
        module('stock-reasons');
        module('referencedata-orderable');
        module('referencedata-lot');

        inject(function($injector) {
            $httpBackend = $injector.get('$httpBackend');
            $rootScope = $injector.get('$rootScope');
            stockmanagementUrlFactory = $injector.get('stockmanagementUrlFactory');
            physicalInventoryService = $injector.get('physicalInventoryService');
            messageService = $injector.get('messageService');

            PhysicalInventoryDataBuilder = $injector.get('PhysicalInventoryDataBuilder');
            PhysicalInventoryLineItemDataBuilder = $injector.get('PhysicalInventoryLineItemDataBuilder');
            PhysicalInventoryLineItemAdjustmentDataBuilder = $injector.get('PhysicalInventoryLineItemAdjustmentDataBuilder');

            OrderableDataBuilder = $injector.get('OrderableDataBuilder');
            LotDataBuilder = $injector.get('LotDataBuilder');
        });

        orderable1 = new OrderableDataBuilder().withFullProductName('Streptococcus Pneumoniae Vaccine II').build();
        orderable2 = new OrderableDataBuilder().build();

        lot = new LotDataBuilder().build();

        stockAdjustment = new PhysicalInventoryLineItemAdjustmentDataBuilder().build();

        physicalInventoryLineItems = [
{'fraction_non_alphanumeric': 0.08809135399673736, 'fraction_numerical': 0.01468189233278956, 'mean_word_length': 3.556564822460776, 'pattern_counts': {'":': 12, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5043510', 'n_tokens_mistral': 1449, 'n_tokens_neox': 1362, 'n_words': 382}