Created
July 27, 2019 10:59
-
-
Save jasongorman/2f8c6927ef32de24a72528dd3b82c77c to your computer and use it in GitHub Desktop.
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
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