From the course: Test-Driven Development in C++

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Overview, setup, and the first test case

Overview, setup, and the first test case - C++ Tutorial

From the course: Test-Driven Development in C++

Overview, setup, and the first test case

- [Instructor] In this section of the course, I'll be preforming another hands-on TDD coding session. For this example, I'll be implementing the supermarket checkout code kata. In this kata, I'll be implementing a checkout class that maintains a list of items that are being added during a checkout at a supermarket. This class should provide interfaces for setting the individual prices on items, adding individual items to the check out, calculating the current total cost from all the items that have been added, and applying optional discount rules where there are N number of a specific item type, i.e. three, four, doll. The checkout class has the following test cases that I'll go through as I'm implementing the class with TDD. The first and simplest test case is for creating an instance of the checkout class, next is the ability to add an item price, then adding an individual item to the list of checkout items, then calculating the current total, then adding multiple items and getting…

Contents