-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestIceCreamOrder1.cpp
More file actions
executable file
·58 lines (44 loc) · 1005 Bytes
/
Copy pathtestIceCreamOrder1.cpp
File metadata and controls
executable file
·58 lines (44 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// testIceCreamOrder1.cpp
// Written for CS32 S18.
#include <iostream>
#include <string>
#include "IceCreamOrder.h"
#include "CustomItem.h"
#include "tddFuncs.h"
using namespace std;
int main() {
cout << "Running tests from: " << __FILE__ << endl;
IceCreamOrder order1;
CustomItem* item1 = new CustomItem("small");
order1.addItem(item1);
string expected =
"Custom Size: small\n\
Toppings:\n\
Price: $3.00\n\
-----\n\
Total: $3.00\n";
ASSERT_EQUALS(expected,order1.printBill());
delete item1;
IceCreamOrder order2;
CustomItem* item2 = new CustomItem("medium");
order2.addItem(item2);
expected =
"Custom Size: medium\n\
Toppings:\n\
Price: $5.00\n\
-----\n\
Total: $5.00\n";
ASSERT_EQUALS(expected,order2.printBill());
delete item2;
IceCreamOrder order3;
CustomItem* item3 = new CustomItem("large");
order3.addItem(item3);
expected =
"Custom Size: large\n\
Toppings:\n\
Price: $6.50\n\
-----\n\
Total: $6.50\n";
ASSERT_EQUALS(expected,order3.printBill());
delete item3;
}