Welcome to your third unit of this course dedicated to practicing Test Driven Development (TDD) utilizing C++ and Google Test. We will begin building a new system; this time, we'll focus on creating a shopping cart module with a variety of features.
In this course, emphasis is placed on hands-on practice, where you'll receive requirements through tests, one at a time. Your task is to write tests and implement code that makes each test pass, simulating a real-world TDD environment. Unlike previous exercises, where tests were supplied, this time you're in charge!
Remember to utilize the core concepts of the Red-Green-Refactor cycle while working through these exercises. Assistance is available, so don't hesitate to ask for help.
- Description: When a new
ShoppingCart
is created in C++, it should start without any items, and the total price should be zero. - Details
- Initialize a new shopping cart using the
ShoppingCart
constructor. - Ensure the method
getItemCount()
returns0
for an empty cart. - Verify the method
getTotal()
returns0.0
for the initial state.
- Initialize a new shopping cart using the
