Giter Club home page Giter Club logo

jv-fruit-shop's Introduction

JUnit practice

Your task is to implement the following requirements and cover at least 80% of your code with JUnit tests. All input data will be passed in the file in CSV format.

Fruit Store

Let's imagine you have a fruit store. There are three type of operations in your fruit store:

    s - supply, means you are receiving a new fruits from suppliers
    b - buy, means someone bought a fruit
    r - return, means someone who have bought the fruits now returns you it

Let's check in details all types of operations:

  1. Supply. You are accepting a new fruit from suppliers. The following line in the file will look like:

       s,banana,100,2020-10-17     
    

    The line above means you receive a 100 bananas, and their expiration date is 17-th October 2020.

  2. Buy. Buyers can visit your shop and buy some fruits. In this case you will have the following line in the file:

       b,banana,13,2020-10-15     
    

    The line above means someone bought a 13 bananas. Date of purchase is 15-th October 2020.

  3. Return. Buyers can return you some fruits. In this case you will have the following line in the file:

       r,banana,10,2020-10-17     
    

    The line above means someone return you a 10 bananas, and their expiration date is 17-th October 2020.

Input file example

    type,fruit,quantity,date
    s,banana,100,2020-10-17
    b,banana,13,2020-10-15
    r,banana,10,2020-10-17 

Expecting output file example

We are expecting to see how many fruits are available in your Fruit store after the file processing. For example:

    fruit,quantity
    banana,97
    orange,147
    apple,29

The line above means you have 97 bananas, 147 oranges and 29 apples in your Fruit store.

ADVANCED:

  • Keep in mind Open-Closed Principle (from SOLID) when you will do this task

jv-fruit-shop's People

Contributors

boroda4436 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.