Created
July 27, 2019 11:21
-
-
Save jasongorman/829643d4ca0684c826ee37269c32a765 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 a label sends a batch of multiple CDs', function(){ | |
it('adds all the received copies to the stock of all received CDs', function(){ | |
const meatloaf = new CD(0, 10, new Description('Bat Out Of Hell', 'Meatloaf')); | |
const catalogue = new Catalogue(contents=[meatloaf], new CdFactory()); | |
const warehouse = new Warehouse(catalogue); | |
const batch = { | |
cds: [ | |
{ | |
title: 'Bat Out Of Hell', | |
artist: 'Meatloaf', | |
copies: 10, | |
price: 9.99 | |
}, | |
{ | |
title: 'So Red The Rose', | |
artist: 'Arcadia', | |
copies: 10, | |
price: 9.99 | |
} | |
] | |
} | |
warehouse.receive(batch); | |
assert.equal(meatloaf.stock, 20); | |
assert.equal(catalogue.search('So Red The Rose', 'Arcadia').stock, 10); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment