Skip to content

Latest commit

 

History

History
33 lines (19 loc) · 1.41 KB

README.md

File metadata and controls

33 lines (19 loc) · 1.41 KB

Codewars

The Supermarket Queue (6 kyu)

Simple Consecutive Pairs (7 kyu)

Powers of i (7 kyu)

Gravity Flip (8 kyu)

Basic Statement Coverage in Unit Testing (retired)

Test the count_ballot() function thoroughly. There is nothing to return. Your function should do all the calls to the 'count_ballot()' function needed to obtain full statement coverage for this function as listed in the problem description. This function takes one parameter - ballot, which is a string that contains the name of the person that was voted for.

Test coverage will be measured automatically.

void test_count_ballot(std::string (*count_ballot)(std::string s)) {

count_ballot("trump & biden"); //should return "Invalid"

count_ballot("trump"); //should return "Trump"

count_ballot("biden"); //should return "Biden"

count_ballot("green"); //should return "Green"

count_ballot(""); //should return "None"

}