Code Monkey home page Code Monkey logo

junit-practice-cart's Introduction

JUnit Shopping Cart Exercise

This task is in beta. Send a message to Ernie for any feedback and constructive criticism.

Based on a project by Filippo Ricca DISI, Università di Genova, Italy.

Instructions

As this is not a submittable assignment, feel free to pair or mob program with other Technologists as needed.

  1. Clone this repo and run the code on an IDE of your choice (this is not a GitHub Classroom repo, so cloning directly is fine)
  2. Use Google find out how to use Maven to install JUnit and create unit tests.
  3. Create JUnit tests to fill the product specifications below.

Product Specifications

  • When created, the cart has 0 items
  • When empty, the cart has 0 items
  • When a new product is added, the number of items must be incremented
  • When a new product is added, the new balance must be the sum of the previous balance plus the cost of the new product
  • When an item is removed, the number of items must be decreased
  • When a product not in the cart is removed, a ProductNotFoundException must be thrown
    • Hint: insert the call in a try block and put a fail() after the call to removeItem()

junit-practice-cart's People

Contributors

ernieatlyd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.