Perdes

Test.cpp

Jan 27th, 2019
132
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.  
  10. int main (){
  11. // The beginnings of a test plan
  12. // Create a new pile
  13. // ( expecting no output )
  14. cout << " Test 1: Create pile " << endl ;
  15. BookPile p;
  16.  
  17. // Expecting a list of no items
  18. // ( expecting no output )
  19. cout << " Test 2: Empty listing " << endl ;
  20. p.ListAllBooks();
  21.  
  22. // Adding an item
  23. // ( expecting no output )
  24. cout << " Test 3: Adding book " << endl ;
  25. Book b;
  26. b.title = " The C++ Standard Library ";
  27. b.author = " Alice Bobson ";
  28. p.AddBook (b) ;
  29.  
  30. // Expect to see a list only containing
  31. // " The C++ Standard Library " by " Alice Bobson "
  32. cout << " Test 4: List books " << endl ;
  33. p.ListAllBooks () ;
  34.  
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment