Last active
August 29, 2015 14:02
-
-
Save heymichaelp/021c975547f63c5daed6 to your computer and use it in GitHub Desktop.
Service Objects: Testing
This file contains hidden or 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
| var expect = require('chai').expect; | |
| var DetermineStudentPassingStatus = require('./determineStudentPassingStatus'); | |
| var Grade = require('./grade'); | |
| describe('DetermineStudentPassingStatus', function(){ | |
| var student = {}; | |
| var determineStudentPassingStatus = new DetermineStudentPassingStatus(student); | |
| describe('#fromAssignments', function(){ | |
| var passing; | |
| it('returns true for passing grades', function(){ | |
| passing = determineStudentPassingStatus.fromAssignments([ | |
| {grade: new Grade(0.5)}, | |
| {grade: new Grade(0.8)}, | |
| {grade: new Grade(0.9)}, | |
| {grade: new Grade(0.6)}, | |
| ]); | |
| expect(passing).to.be.true; | |
| }) | |
| it('returns false for failing grades', function(){ | |
| passing = determineStudentPassingStatus.fromAssignments([ | |
| {grade: new Grade(0.5)}, | |
| {grade: new Grade(0.4)}, | |
| {grade: new Grade(0.8)}, | |
| {grade: new Grade(0.6)}, | |
| ]); | |
| expect(passing).to.be.false; | |
| }); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment