Skip to content

MohRezam/m102_test_exercise-CW-

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Shopping Cart Exercise

Welcome to the Shopping Cart exercise! In this exercise, you will be working with a basic shopping cart implementation in Python. The ShoppingCart class allows you to add items, remove items, calculate statistics, and perform various operations on a shopping cart.

Instructions

Your task is to complete the following steps:

  1. Fork this repository to your GitHub account.
  2. Clone the forked repository to your local machine.
  3. Open the shopping_cart.py file and implement the missing functionalities marked with # TODO comments.
  4. Write test cases in the test_shopping_cart.py file to ensure the correctness of the implemented functionalities.
  5. Run the test cases using python test_shopping_cart.py and make sure all tests pass.
  6. Make any necessary modifications and improvements to the code.
  7. Commit and push your changes to your GitHub repository.
  8. Submit a pull request to the original repository to share your solution.

Files

The repository contains the following files:

  • shopping_cart.py: The main Python file that contains the incomplete ShoppingCart class. You need to complete the missing functionalities.
  • test_shopping_cart.py: The unit tests for the ShoppingCart class. You should write additional test cases to cover all scenarios.
  • README.md: This file, providing instructions and information about the exercise.

Requirements

To complete this exercise, you need to have the following:

  • Python (version 3.6 or above) installed on your machine.
  • A text editor or an integrated development environment (IDE) to write and modify Python code.
  • Basic knowledge of Python and object-oriented programming concepts.
  • Familiarity with writing and running test cases using the unittest framework.

Guidelines

  • Read the code comments in the shopping_cart.py file to understand the required functionalities.
  • Follow the test-driven development (TDD) approach by writing test cases first and then implementing the required functionalities.
  • Write clear and concise code with proper variable names and comments to enhance code readability.
  • Feel free to add any additional features or improvements to the shopping cart implementation.
  • If you face any issues or have any questions, don't hesitate to ask for help.

Resources

Good luck with the exercise! Happy coding!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%