-
Notifications
You must be signed in to change notification settings - Fork 6
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
Showing
7 changed files
with
70 additions
and
17 deletions.
There are no files selected for viewing
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,41 @@ | ||
import Allocation from '../src/Allocation'; | ||
import AllocationManagerImpl from '../src/AllocationManagerImpl'; | ||
import ArrayModelStore from '../src/ArrayModelStore'; | ||
import Developer from '../src/Developer'; | ||
import Project from '../src/Project'; | ||
import Technology from '../src/Technology'; | ||
|
||
describe('AllocationManagerImpl', function () { | ||
describe('getFreeDevelopersForTechnology', function () { | ||
it('should give empty array when no developer exists for technology', function () { | ||
const developerStore = new ArrayModelStore<Developer>(); | ||
const projectStore = new ArrayModelStore<Project>(); | ||
const allocationStore = new ArrayModelStore<Allocation>(); | ||
const alloc_manager = new AllocationManagerImpl(projectStore, developerStore, allocationStore); | ||
|
||
const freeDevelopersForJava = alloc_manager.getFreeDevelopersForTechnology(Technology.JAVA); | ||
|
||
expect(freeDevelopersForJava).toEqual([]); | ||
}); | ||
}); | ||
|
||
describe('getFreeDevelopersForTechnology', function () { | ||
it('should give free developers for technology', function () { | ||
const developerStore = new ArrayModelStore<Developer>(); | ||
developerStore.add(new Developer({ id: 1, name: 'Kick', knownTechnologies: [Technology.JAVA] })); | ||
developerStore.add(new Developer({ id: 2, name: 'Nick', knownTechnologies: [Technology.JAVA] })); | ||
|
||
const projectStore = new ArrayModelStore<Project>(); | ||
const allocationStore = new ArrayModelStore<Allocation>(); | ||
const alloc_manager = new AllocationManagerImpl(projectStore, developerStore, allocationStore); | ||
|
||
const freeDevelopersForJava = alloc_manager.getFreeDevelopersForTechnology(Technology.JAVA); | ||
|
||
expect(freeDevelopersForJava).toEqual([ | ||
new Developer({ id: 1, name: 'Kick', knownTechnologies: [Technology.JAVA] }), | ||
new Developer({ id: 2, name: 'Nick', knownTechnologies: [Technology.JAVA] }), | ||
]); | ||
}); | ||
}); | ||
|
||
}); |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
type Technology = string; | ||
enum Technology { | ||
JAVA, | ||
PYTHON, | ||
JAVASCRIPT, | ||
} | ||
|
||
export default Technology; |
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