Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('testing auto service class', function () {
- let tested = new AutoService(10);
- it('Testing constructor prop num', function () {
- expect(tested.garageCapacity).to.be.equal(10);
- });
- it('Testing workInProgress', function () {
- expect(tested.workInProgress).to.be.deep.equal([]);
- });
- it('Testing backlocg', function () {
- expect(tested.backlogWork).to.be.deep.equal([]);
- });
- it('testing available space', function () {
- expect(tested.availableSpace).to.be.equal(10);
- });
- it('testing signupForReview', function () {
- tested.signUpForReview('Peter', 'CA1234CA', { 'engine': 'MFRGG23', 'transmission': 'FF4418ZZ', 'doors': 'broken' });
- let output = {
- plateNumber: 'CA1234CA',
- clientName: 'Peter',
- carInfo:
- { engine: 'MFRGG23', transmission: 'FF4418ZZ', doors: 'broken' }
- }
- expect(tested.workInProgress[0]).to.be.deep.equal(output);
- });
- it('testing signupForReview', function () {
- let tested = new AutoService(0);
- tested.signUpForReview('Peter', 'CA1234CA', { 'engine': 'MFRGG23', 'transmission': 'FF4418ZZ', 'doors': 'broken' });
- let output = {
- plateNumber: 'CA1234CA',
- clientName: 'Peter',
- carInfo:
- { engine: 'MFRGG23', transmission: 'FF4418ZZ', doors: 'broken' }
- }
- expect(tested.backlogWork[0]).to.be.deep.equal(output);
- });
- it('testing carInfo', function () {
- let tested = new AutoService(0);
- tested.signUpForReview('Peter', 'CA1234CA', { 'engine': 'MFRGG23', 'transmission': 'FF4418ZZ', 'doors': 'broken' });
- let output = 'There is no car with platenumber Peter and owner CA1234CA.'
- expect(tested.carInfo('Peter', 'CA1234CA')).to.be.equal(output);
- });
- it('testing info', function () {
- let tested = new AutoService(10);
- tested.signUpForReview('Peter', 'CA1234CA', { 'engine': 'MFRGG23', 'transmission': 'FF4418ZZ', 'doors': 'broken' });
- let output = {
- plateNumber: 'CA1234CA',
- clientName: 'Peter',
- carInfo:
- {
- engine: 'MFRGG23',
- transmission: 'FF4418ZZ',
- doors: 'broken'
- }
- }
- expect(tested.carInfo('CA1234CA', 'Peter')).to.be.deep.equal(output);
- });
- it('repair car - broken', function(){
- let tested = new AutoService(2);
- tested.signUpForReview('Peter', 'CA1234CA', { 'engine': 'MFRGG23', 'transmission': 'FF4418ZZ', 'doors': 'broken' });
- let output = 'Your doors were repaired.'
- expect(tested.repairCar()).to.be.equal(output);
- });
- it('repair car - all good', function() {
- let tested = new AutoService(2);
- tested.signUpForReview('Philip', 'PB4321PB', { 'engine': 'MFRGG23', 'transmission': 'FF4418ZZ', 'exaustPipe': 'REMUS'});
- let output = 'Your car was fine, nothing was repaired.'
- expect(tested.repairCar()).to.be.equal(output);
- });
- it('repair car - no client', function() {
- let tested = new AutoService(2);
- let output = 'No clients, we are just chilling...'
- expect(tested.repairCar()).to.be.equal(output);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement