{"size": 1116, "ext": "js", "max_stars_repo_path": "test/os/unit/unitfactory.test.js", "max_stars_repo_name": "dpew/opensphere", "max_stars_repo_stars_event_min_datetime": "2017-12-19T15:16:08.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-17T21:09:14.000Z", "max_issues_repo_path": "test/os/unit/unitfactory.test.js", "max_issues_repo_name": "dpew/opensphere", "max_issues_repo_issues_event_min_datetime": "2017-12-21T10:01:49.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-24T13:02:47.000Z", "max_forks_repo_path": "test/os/unit/unitfactory.test.js", "max_forks_repo_name": "dpew/opensphere", "max_forks_repo_forks_event_min_datetime": "2017-12-18T01:51:06.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-06T14:18:27.000Z"}
{"max_stars_count": 170, "max_issues_count": 571, "max_forks_count": 90, "avg_line_length": 50.7272727273, "max_line_length": 119, "alphanum_fraction": 0.70609319}
goog.require('os.unit.Multiplier');
goog.require('os.unit.UnitFactory');

describe('os.unit.UnitFactory', function() {
  const {default: Multiplier} = goog.module.get('os.unit.Multiplier');
  const {default: UnitFactory} = goog.module.get('os.unit.UnitFactory');

  it('should function correctly', inject(function($rootScope) {
    var mult = new Multiplier('m', 1, true, 'meters');
    var unitFactory = new UnitFactory();
    expect(unitFactory.getUnit('electric', 'jigawatts')).toBeNull(); // imaginary units + made up system
    expect(unitFactory.getUnit('metric', 'jigawatts')).toBe(undefined); // imaginary units + real system
    expect(unitFactory.getUnit('electric', 'distance')).toBeNull(); // real units + made up system
    expect(unitFactory.getUnit('metric', 'distance').getDefaultMultiplier()).toEqual(mult); // real units + real system
    expect(unitFactory.getSystems().length).toBe(7);
    expect(Object.keys(unitFactory.getFullSystems()).length).toBe(7);
    // code coverage of compiler appeasement
    unitFactory.systems_ = {};
    expect(unitFactory.getSystems().length).toBe(0);
  }));
});
