-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f78def7
commit c1834fe
Showing
23 changed files
with
119 additions
and
345 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...untime/test/models/Implementation.spec.ts → ...cution/test/models/Implementation.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/runtime/test/models/Segment.spec.ts → ...ges/execution/test/models/Segment.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/runtime/test/models/Version.spec.ts → ...ges/execution/test/models/Version.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/execution/test/models/fixtures/executables.fixture.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
export const EXECUTABLES = | ||
{ | ||
PRIVATE: () => { return 'private'; }, | ||
PROTECTED: () => { return 'protected'; }, | ||
PUBLIC: () => { return 'public'; }, | ||
PARAMETERS: (mandatory: string, optional = 'default') => { return `${mandatory} ${optional}`; }, | ||
BROKEN: () => { throw new Error('broken'); }, | ||
CONTEXT: () => { return this; }, | ||
V1_0_0: () => { return '1.0.0'; }, | ||
V1_0_5: () => { return '1.0.5'; }, | ||
V1_1_0: () => { return '1.1.0'; } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
export * from './executables.fixture'; | ||
export * from './implementations.fixture'; | ||
export * from './parameters.fixture'; | ||
export * from './procedures.fixture'; | ||
export * from './segments.fixture'; | ||
export * from './versions.fixture'; |
6 changes: 1 addition & 5 deletions
6
...est/_fixtures/models/Parameter.fixture.ts → ...est/models/fixtures/parameters.fixture.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
|
||
import NamedParameter from '../../../src/models/NamedParameter'; | ||
|
||
const PARAMETERS = | ||
export const PARAMETERS = | ||
{ | ||
MANDATORY: new NamedParameter('mandatory', false), | ||
OPTIONAL: new NamedParameter('optional', true) | ||
}; | ||
|
||
Object.freeze(PARAMETERS); | ||
|
||
export { PARAMETERS }; |
33 changes: 9 additions & 24 deletions
33
...est/_fixtures/models/Procedure.fixture.ts → ...est/models/fixtures/procedures.fixture.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,30 @@ | ||
|
||
import Procedure from '../../../src/models/Procedure'; | ||
|
||
import { IMPLEMENTATIONS } from './Implementation.fixture'; | ||
import { IMPLEMENTATIONS } from './implementations.fixture'; | ||
|
||
const PROCEDURES = | ||
export const PROCEDURES = | ||
{ | ||
// General | ||
PRIVATE: new Procedure('private') | ||
.addImplementation(IMPLEMENTATIONS.PRIVATE), | ||
|
||
PROTECTED: new Procedure('protected') | ||
.addImplementation(IMPLEMENTATIONS.PROTECTED), | ||
|
||
PUBLIC: new Procedure('public') | ||
.addImplementation(IMPLEMENTATIONS.PUBLIC), | ||
|
||
PARAMETERS: new Procedure('parameter') | ||
.addImplementation(IMPLEMENTATIONS.PARAMETERS), | ||
|
||
BROKEN: new Procedure('broken') | ||
.addImplementation(IMPLEMENTATIONS.BROKEN), | ||
|
||
CONTEXT: new Procedure('context') | ||
.addImplementation(IMPLEMENTATIONS.CONTEXT), | ||
|
||
VERSIONED: new Procedure('versioned') | ||
.addImplementation(IMPLEMENTATIONS.V1_0_0) | ||
.addImplementation(IMPLEMENTATIONS.V1_0_5) | ||
.addImplementation(IMPLEMENTATIONS.V1_1_0), | ||
|
||
// First segment | ||
FIRST: new Procedure('first') | ||
.addImplementation(IMPLEMENTATIONS.FIRST), | ||
SECOND: new Procedure('second') | ||
.addImplementation(IMPLEMENTATIONS.SECOND), | ||
THIRD: new Procedure('third') | ||
.addImplementation(IMPLEMENTATIONS.THIRD), | ||
|
||
// Second segment | ||
FOURTH: new Procedure('fourth') | ||
.addImplementation(IMPLEMENTATIONS.FOURTH), | ||
FIFTH: new Procedure('fifth') | ||
.addImplementation(IMPLEMENTATIONS.FIFTH), | ||
SIXTH: new Procedure('sixth') | ||
.addImplementation(IMPLEMENTATIONS.SIXTH) | ||
.addImplementation(IMPLEMENTATIONS.V1_1_0) | ||
}; | ||
|
||
Object.freeze(PROCEDURES); | ||
|
||
export { PROCEDURES }; |
16 changes: 16 additions & 0 deletions
16
packages/execution/test/models/fixtures/segments.fixture.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
import Segment from '../../../src/models/Segment'; | ||
|
||
import { PROCEDURES } from './procedures.fixture'; | ||
|
||
export const SEGMENTS = | ||
{ | ||
GENERAL: new Segment('general') | ||
.addProcedure(PROCEDURES.PRIVATE) | ||
.addProcedure(PROCEDURES.PROTECTED) | ||
.addProcedure(PROCEDURES.PUBLIC) | ||
.addProcedure(PROCEDURES.PARAMETERS) | ||
.addProcedure(PROCEDURES.BROKEN) | ||
.addProcedure(PROCEDURES.CONTEXT) | ||
.addProcedure(PROCEDURES.VERSIONED) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
export * from './arguments.fixture'; | ||
export * from './parameters.fixture'; | ||
export * from './versions.fixture'; |
33 changes: 33 additions & 0 deletions
33
packages/execution/test/utils/fixtures/parameters.fixture.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
import ArrayParameter from '../../../src/models/ArrayParameter'; | ||
import NamedParameter from '../../../src/models/NamedParameter'; | ||
import ObjectParameter from '../../../src/models/ObjectParameter'; | ||
|
||
export const PARAMETERS = | ||
{ | ||
NAMED: [new NamedParameter('id', false), new NamedParameter('name', false), new NamedParameter('age', true)], | ||
ARRAY: [new ArrayParameter([new NamedParameter('query', false), new NamedParameter('sort', true)])], | ||
OBJECT: [new ObjectParameter([new NamedParameter('query', false), new NamedParameter('sort', true)])], | ||
MIXED: [ | ||
new NamedParameter('id', false), | ||
new ArrayParameter([new NamedParameter('name', false), new NamedParameter('age', true)]), | ||
new ObjectParameter([new NamedParameter('query', false), new NamedParameter('sort', true)]) | ||
], | ||
NESTED_ARRAY: [ | ||
new ArrayParameter([ | ||
new NamedParameter('id', false), | ||
new ArrayParameter([new NamedParameter('name', false), new NamedParameter('age', true)]), | ||
new ObjectParameter([new NamedParameter('query', false), new NamedParameter('sort', false)], undefined, true) | ||
]) | ||
], | ||
NESTED_OBJECT: [ | ||
new ObjectParameter([ | ||
new NamedParameter('id', false), | ||
new ArrayParameter([new NamedParameter('name', false), new NamedParameter('age', true)], 'person'), | ||
new ObjectParameter([new NamedParameter('query', false), new NamedParameter('sort', false)], 'filter', true) | ||
]) | ||
], | ||
REST: [new NamedParameter('...rest', false)], | ||
REST_ARRAY: [new ArrayParameter([new NamedParameter('name', false), new NamedParameter('...rest', true)])], | ||
REST_OBJECT: [new ObjectParameter([new NamedParameter('name', false), new NamedParameter('...rest', true)])] | ||
}; |
13 changes: 13 additions & 0 deletions
13
packages/execution/test/utils/fixtures/versions.fixture.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
import Version from '../../../src/models/Version'; | ||
|
||
export const VERSIONS = | ||
{ | ||
DEFAULT: Version.DEFAULT, | ||
ACTUAL: new Version(1, 2, 3), | ||
EQUAL: new Version(1, 2, 3), | ||
GREATER: new Version(10, 2, 3), | ||
LESSER: new Version(1, 1, 3), | ||
MAJOR: new Version(1, 0, 0), | ||
MAJOR_MINOR: new Version(1, 2, 0) | ||
}; |
Oops, something went wrong.