Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created July 27, 2019 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongorman/2f8c6927ef32de24a72528dd3b82c77c to your computer and use it in GitHub Desktop.
Save jasongorman/2f8c6927ef32de24a72528dd3b82c77c to your computer and use it in GitHub Desktop.
describe('When the CD is not in the catalogue', function(){
const catalogue = new Catalogue(contents=[], new CdFactory());
const warehouse = new Warehouse(catalogue);
const batch = {
cds: [
{
title: 'Bat Out Of Hell',
artist: 'Meatloaf',
copies: 10,
price: 9.99
}
]
}
warehouse.receive(batch);
const cd = catalogue.search('Bat Out Of Hell', 'Meatloaf');
it('adds the CD to the catalogue with received copies for initial stock', function(){
assert.equal(cd.stock, 10);
})
it('sets the price for the new CD', function(){
assert.equal(cd.price, 9.99);
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment