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 - 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Overview, setup, and the first test case6m 10s
-
(Locked)
Add items, add item prices, and calculate the current total9m 56s
-
(Locked)
Add multiple items and calculate the total3m 49s
-
(Locked)
Add and apply discounts19m 37s
-
(Locked)
Throw an exception when adding an item with no price3m 2s
-
(Locked)
-
-
-