1 import {IdlService} from './idl.service';
3 describe('IdlService', () => {
4 let service: IdlService;
6 service = new IdlService();
9 it('should parse the IDL', () => {
11 expect(service.classes['aou'].fields.length).toBeGreaterThan(0);
14 it('should create an aou object', () => {
16 const org = service.create('aou');
17 expect(typeof org.id).toBe('function');
20 it('should create an aou object with accessor/mutators', () => {
22 const org = service.create('aou');
24 expect(org.name()).toBe('AN ORG');
27 it('should correctly compare IDL pkey values', () => {
29 const org1 = service.create('aou');
30 const org2 = service.create('aou');
33 expect(service.pkeyMatches(org1, org2)).toBe(true);
36 it('should correctly compare IDL pkey values', () => {
38 const org1 = service.create('aou');
39 const org2 = service.create('aou');
42 expect(service.pkeyMatches(org1, org2)).toBe(false);
45 it('should correctly compare IDL classes in pkey match', () => {
47 const org = service.create('aou');
48 const user = service.create('au');
51 expect(service.pkeyMatches(org, user)).toBe(false);