Giter Site home page Giter Site logo

joi-grad-shopping-cart-csharp's Introduction

Welcome to Shopping Cart

Read this in other languages: English, Português do Brasil.

This is where you can start to get familiar with the problem and what you need to run it. This codebase is used during pairing session for JOI initiative. It's focused on identifying code smells, refactoring and testing legacy codebase while promoting conversations.

Problem Statement

We have an existing shopping cart application, with a small set of eCommerce/shopping cart rules. Rules include calculation of total price, discount and loyalty points calculation. Most of the business logic is implemented in single method ShoppingCart.checkout.

Technology used

  • C#
  • .NET Core
  • .NET Core CLI - build tool
  • xUnit.net - unit testing framework

Before the interview

Get familiar with the codebase! Make sure you have the necessary dependencies installed, and that you are able to run the tests.

What you need to run it

Build

dotnet build

Run Tests

dotnet test

Run the Sample Application

To understand how this library would be used you can check the Main method in the SampleApp class. If you want to see the results, run:

dotnet run --project src/JoiGradShoppingcart/JoiGradShoppingcart.csproj

Existing Business Rules

Application code currently has following rules:

  • Calculates total price and total loyalty points earned by the customer.
  • Products with product code starting with DIS_10 have a 10% discount applied.
  • Products with product code starting with DIS_15 have a 15% discount applied.
  • Loyalty points are earned more when the product is not under any offer.
    • Customer earns 1 point on every $5 purchase.
    • Customer earns 1 point on every $10 spent on a product with 10% discount.
    • Customer earns 1 point on every $15 spent on a product with 15% discount.

joi-grad-shopping-cart-csharp's People

Contributors

furfreemi avatar thayseonofrio avatar santochan avatar wolesolana avatar gaoyuyue avatar

Watchers

Johann Gomes Barros Lima avatar  avatar Mauricio Borges Silva avatar James Cloos avatar Albert Attard avatar  avatar  avatar  avatar Rima Gaikwad avatar  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.