Skip to content

Instantly share code, notes, and snippets.

@heymichaelp
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save heymichaelp/021c975547f63c5daed6 to your computer and use it in GitHub Desktop.

Select an option

Save heymichaelp/021c975547f63c5daed6 to your computer and use it in GitHub Desktop.
Service Objects: Testing
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