Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created July 27, 2019 10:28
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/d1dd06d15164d141d46d81bb74063d9c to your computer and use it in GitHub Desktop.
Save jasongorman/d1dd06d15164d141d46d81bb74063d9c to your computer and use it in GitHub Desktop.
it('sets the price for the new CD', 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');
assert.equal(cd.price, 9.99);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment