Write a unit test for addinventory(). call redsweater.addinventory() with parameter sweatershipment. print the shown error if th e subsequent quantity is incorrect. sample output for failed unit test given initial quantity is 10 and sweatershipment is 50: beginning tests. unit test failed: addinventory() tests complete. note: unit test failed is preceded by 3 spaces.
1 answer:
<span>#include <iostream>
using namespace std;
class InventoryTag {
public:
InventoryTag();
int getQuantityRemaining() const;
void addInventory(int numItems);
private:
int quantityRemaining;
};
InventoryTag::InventoryTag() {
quantityRemaining = 0;
}
int InventoryTag::getQuantityRemaining() const {
return quantityRemaining;
}
void InventoryTag::addInventory(int numItems) {
if (numItems > 10) {
quantityRemaining = quantityRemaining + numItems;
}
}
int main() {
InventoryTag redSweater;
int sweaterShipment = 0;
int sweaterInventoryBefore = 0;
sweaterInventoryBefore = redSweater.getQuantityRemaining();
sweaterShipment = 25;
cout << "Beginning tests." << endl;
// FIXME add unit test for addInventory
/* Your solution goes here */
cout << "Tests complete." << endl;
return 0;
}</span>
You might be interested in
Answer:
X=22
Step-by-step explanation:
It would be B. I had this same question.
The answer is C.) f^-1 (x) = 2x- 14 /
Answer:
T = 1yrs and 8month
Step-by-step explanation:
S.I = $97.3O
S.I = PTR/100
$<u>97.30</u> = <u>$1200 × 4.5 × T</u>
1 100
Cross multiply
$5400T = $9730
divide both sides by$5400
T = 1.8yrs
6:10 is 47 mins before 6:57!!