Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat (root types) : add abstract root types in concerto ns #230

Merged
merged 3 commits into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/concerto-core/lib/modelmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ class ModelManager {
*/
addRootModel() {
this.addModelFile( `namespace concerto
concept Concept {
}`, 'concerto.cto');
abstract concept Concept {}
abstract asset Asset {}
abstract transaction Transaction {}
abstract participant Participant {}
abstract event Event {}`, 'concerto.cto');
}

/**
Expand Down
31 changes: 31 additions & 0 deletions packages/concerto-core/test/modelmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,39 @@ describe('ModelManager', () => {
let mockModelFile = sinon.createStubInstance(ModelFile);
modelManager.validateModelFile(mockModelFile);
sinon.assert.calledOnce(mockModelFile.validate);
});
});

describe('#concerto namespace', () => {

it('should contain Asset', () => {
const fqn = 'concerto.Asset';
const type = modelManager.getType(fqn);
type.getFullyQualifiedName().should.equal(fqn);
});

it('should contain Participant', () => {
const fqn = 'concerto.Participant';
const type = modelManager.getType(fqn);
type.getFullyQualifiedName().should.equal(fqn);
});

it('should contain Event', () => {
const fqn = 'concerto.Event';
const type = modelManager.getType(fqn);
type.getFullyQualifiedName().should.equal(fqn);
});

it('should contain Transaction', () => {
const fqn = 'concerto.Transaction';
const type = modelManager.getType(fqn);
type.getFullyQualifiedName().should.equal(fqn);
});

it('should contain Concept', () => {
const fqn = 'concerto.Concept';
const type = modelManager.getType(fqn);
type.getFullyQualifiedName().should.equal(fqn);
});
});

Expand Down