Perdes

Test.cpp

Jan 27th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include "bookpile.h"
  5.  
  6.  
  7. using namespace std;
  8.  
  9. int main (){
  10. // The beginnings of a test plan
  11. // Create a new pile
  12. // ( expecting no output )
  13. cout << " Test 1: Create pile " << endl ;
  14. class BookPile p;
  15.  
  16. // Expecting a list of no items
  17. // ( expecting no output )
  18. cout << " Test 2: Empty listing " << endl ;
  19. p.ListAllBooks () ;
  20.  
  21. // Adding an item
  22. // ( expecting no output )
  23. cout << " Test 3: Adding book " << endl ;
  24. Book b ;
  25. b.title = " The C++ Standard Library ";
  26. b.author = " Alice Bobson ";
  27. p.AddBook (b) ;
  28.  
  29. // Expect to see a list only containing
  30. // " The C++ Standard Library " by " Alice Bobson "
  31. cout << " Test 4: List books " << endl ;
  32. p.ListAllBooks () ;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment