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:
106ft by 2
Step-by-step explanation:
Answer:
ksajcsxkb asljbas akajs
Step-by-step explanation: sxakn skdj
Step-by-step explanation:
boom therrs tha answer
0.3 if a higher number because anytime there is a negative that means the number is below zero. 0.3 is barley above 0. But -0.7 is below zero
Each piece = (4/5) yards
(4/5) yards * 3 feet = 2.4 feet each piece
which equals 2 feet 4.8 inches each