|
1 |
| -import { score } from './index'; |
| 1 | +import { score, Scorer } from './index'; |
2 | 2 |
|
3 | 3 | describe('score', () => {
|
4 | 4 | it('should return 0 if candidate is not a smoker and has a regular certification grade', () => {
|
@@ -33,3 +33,41 @@ describe('score', () => {
|
33 | 33 | expect(score(candidate, medicalExam, scoringGuide)).toBe(-10);
|
34 | 34 | });
|
35 | 35 | });
|
| 36 | + |
| 37 | +describe('Scorer', () => { |
| 38 | + it('should return 0 if candidate is not a smoker and has a regular certification grade', () => { |
| 39 | + const candidate = { originState: 'FL' }; |
| 40 | + const medicalExam = { isSmoker: false }; |
| 41 | + const scoringGuide = { stateWithLowCertification: () => false }; |
| 42 | + |
| 43 | + const scorer = new Scorer(); |
| 44 | + expect(scorer.execute(candidate, medicalExam, scoringGuide)).toBe(0); |
| 45 | + }); |
| 46 | + |
| 47 | + it('should return -5 if candidate is not a smoker and has a low certification grade', () => { |
| 48 | + const candidate = { originState: 'FL' }; |
| 49 | + const medicalExam = { isSmoker: false }; |
| 50 | + const scoringGuide = { stateWithLowCertification: () => true }; |
| 51 | + |
| 52 | + const scorer = new Scorer(); |
| 53 | + expect(scorer.execute(candidate, medicalExam, scoringGuide)).toBe(-5); |
| 54 | + }); |
| 55 | + |
| 56 | + it('should return -5 if candidate is a smoker and has a regular certification grade', () => { |
| 57 | + const candidate = { originState: 'FL' }; |
| 58 | + const medicalExam = { isSmoker: true }; |
| 59 | + const scoringGuide = { stateWithLowCertification: () => false }; |
| 60 | + |
| 61 | + const scorer = new Scorer(); |
| 62 | + expect(scorer.execute(candidate, medicalExam, scoringGuide)).toBe(-5); |
| 63 | + }); |
| 64 | + |
| 65 | + it('should return -10 if candidate is a smoker and has a low certification grade', () => { |
| 66 | + const candidate = { originState: 'FL' }; |
| 67 | + const medicalExam = { isSmoker: true }; |
| 68 | + const scoringGuide = { stateWithLowCertification: () => true }; |
| 69 | + |
| 70 | + const scorer = new Scorer(); |
| 71 | + expect(scorer.execute(candidate, medicalExam, scoringGuide)).toBe(-10); |
| 72 | + }); |
| 73 | +}); |
0 commit comments