Modern C++ Programming with Test-Driven Development (for Lorinda Hartzler) by Jeff Langr

Modern C++ Programming with Test-Driven Development (for Lorinda Hartzler) by Jeff Langr

Author:Jeff Langr
Language: eng
Format: epub
Tags: Pragmatic Bookshelf
ISBN: 978-1-937785-48-2
Publisher: The Pragmatic Bookshelf, LLC (448677)


​ purchases_.push_back(PurchaseRecord(shareChange, transactionDate));

​ }

One more little expressiveness thing is that the name of our exception type InvalidSellException is not very good. Let’s change it to InsufficientSharesException.

c6/14/PortfolioTest.cpp

​ TEST_F(APortfolio, ThrowsWhenSellingMoreSharesThanPurchased) {

​*

​ ASSERT_THROW(Sell(SAMSUNG, 1), InsufficientSharesException);

​ }

c6/14/Portfolio.cpp

​ ​void​ Portfolio::Sell(

​ ​const​ ​string​& symbol, ​unsigned​ ​int​ shareCount, ​const​ date& transactionDate) {



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.