-
Notifications
You must be signed in to change notification settings - Fork 2
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
Travis Rollins
committed
Feb 15, 2019
0 parents
commit 09fc411
Showing
8 changed files
with
351 additions
and
0 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 @@ | ||
node_modules/ |
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,8 @@ | ||
# Airport and Plane | ||
|
||
## Installation Steps | ||
|
||
1. Clone the repo | ||
2. From the cloned directory, run `npm install` | ||
3. Run your first test suite `npm test airport-test.js` | ||
4. Make the tests pass |
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,36 @@ | ||
var assert = require('chai').assert | ||
var Airport = require('./airport'); | ||
|
||
describe('Airport', function() { | ||
it.skip('should be a function', function () { | ||
assert.isFunction(Airport); | ||
}); | ||
|
||
it.skip('should instantiate our aiport', function () { | ||
var airport = new Airport(); | ||
|
||
assert.isObject(airport); | ||
}); | ||
|
||
it.skip('should have a school name', function() { | ||
var airport1 = new Airport('Denver International Airport'); | ||
var airport2 = new Airport('Newark Liberty International Airport'); | ||
|
||
assert.equal(airport1.name, 'Denver International Airport'); | ||
assert.equal(airport2.name, 'Newark Liberty International Airport'); | ||
}); | ||
|
||
it.skip('should default with no planes stationed', function() { | ||
var airport = new Airport('Denver International Airport'); | ||
|
||
assert.deepEqual(airport.planes, []); | ||
}); | ||
|
||
it.skip('should know how many stations are available', function() { | ||
var airport1 = new Airport('Denver International Airport', 12); | ||
var airport2 = new Airport('Newark Liberty International Airport', 4); | ||
|
||
assert.equal(airport1.stationsAvailable, 12); | ||
assert.equal(airport2.stationsAvailable, 4); | ||
}); | ||
}); |
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,16 @@ | ||
{ | ||
"name": "foundations", | ||
"version": "1.0.0", | ||
"description": "Final Code Challenge for Mod 1 FE", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"author": "Turing School", | ||
"license": "MIT", | ||
"devDependencies": {}, | ||
"dependencies": { | ||
"chai": "^4.2.0", | ||
"mocha": "^5.2.0" | ||
} | ||
} |
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,72 @@ | ||
var assert = require('chai').assert | ||
var Plane = require('./plane'); | ||
var Airport = require('./airport'); | ||
|
||
describe('User', function() { | ||
it.skip('should be able to have a name and passengers', function() { | ||
var plane1 = new Plane({ name: 'Southwest', passengers: ['Louisa', 'Khalid'] }); | ||
var plane2 = new Plane({ name: 'Frontier', passengers: ['Robbie', 'Brittany'] }); | ||
|
||
assert.equal(plane1.name, 'Southwest'); | ||
assert.deepEqual(plane1.passengers, ['Louisa', 'Khalid']) | ||
|
||
assert.equal(plane2.name, 'Frontier'); | ||
assert.deepEqual(plane2.passengers, ['Robbie', 'Brittany']) | ||
}) | ||
|
||
it.skip('should not have any passengers by default', function() { | ||
var plane = new Plane({ name: 'United' }); | ||
|
||
assert.deepEqual(plane.passengers, []); | ||
}); | ||
|
||
it.skip('should be able to thank passengers for choosing their airline', function() { | ||
var plane1 = new Plane({ name: 'Southwest', passengers: ['Louisa', 'Khalid'] }); | ||
var plane2 = new Plane({ name: 'Frontier', passengers: ['Robbie', 'Brittany'] }); | ||
|
||
assert.equal(plane1.thankPassenger(), 'Thank you for choosing the Southwest airline.') | ||
assert.equal(plane2.thankPassenger(), 'Thank you for choosing the Frontier airline.') | ||
}) | ||
|
||
it.skip('should be able to accept passengers', function() { | ||
var plane = new Plane({ name: 'Southwest', passengers: ['Louisa', 'Khalid'] }); | ||
|
||
plane.acceptNewPassengers(['Will', 'Leta', 'David']); | ||
assert.deepEqual(plane.passengers, ['Louisa', 'Khalid', 'Will', 'Leta', 'David']); | ||
}); | ||
|
||
it.skip('should be able to travel to an airport', function() { | ||
var airport = new Airport('Denver International Airport', 12); | ||
var plane1 = new Plane({ name: 'Southwest', passengers: ['Louisa', 'Khalid'] }); | ||
var plane2 = new Plane({ name: 'Frontier', passengers: ['Robbie', 'Brittany'] }); | ||
|
||
plane1.travelTo(airport); | ||
assert.equal(airport.planes[0].name, 'Southwest'); | ||
|
||
plane2.travelTo(airport); | ||
assert.equal(airport.planes[0].name, 'Frontier'); | ||
assert.equal(airport.planes[1].name, 'Southwest'); | ||
}); | ||
|
||
it.skip('should not be able to travel to an airport if there are no stations available', function() { | ||
var airport = new Airport('Denver International Airport', 2); | ||
var plane1 = new Plane({ name: 'Southwest', passengers: ['Louisa', 'Khalid'] }); | ||
var plane2 = new Plane({ name: 'Frontier', passengers: ['Robbie', 'Brittany'] }); | ||
var plane3 = new Plane({ name: 'United', passengers: ['Travis', 'Pam'] }); | ||
|
||
assert.equal(airport.stationsAvailable, 2); | ||
|
||
plane1.travelTo(airport); | ||
assert.equal(airport.stationsAvailable, 1); | ||
|
||
plane2.travelTo(airport); | ||
assert.equal(airport.stationsAvailable, 0); | ||
assert.equal(airport.planes[0].name, 'Frontier'); | ||
assert.equal(airport.planes[1].name, 'Southwest'); | ||
|
||
plane3.travelTo(airport); | ||
assert.equal(airport.stationsAvailable, 0); | ||
assert.equal(airport.planes[0].name, 'Frontier'); | ||
assert.equal(airport.planes[1].name, 'Southwest'); | ||
}); | ||
}); |
Empty file.