Coder Social home page Coder Social logo

bowlinggame's Introduction

Overview

This is an interview question from BNP Paris.

BowlingGame

Required to implement a bowling game. More info on the rules at: how to score for bowling

How to run

We use JUnit for testing. There are several ways (maven, gradle, ant, etc.) to compile and run the tests. Here, I show you how to use command line to run the tests.

1. Downloads

We need JUnit-5.4.0 to build and JUnit-platform-console-standalone-1.4.0 to print test execution results to the console.

2. Compile

Create out folder to store our compiled java files

mkdir out

We use JUnit-5.4.0 to build

javac -cp junit-jupiter-api-5.4.0.jar BowlingGame.java BowlingGameTest.java -nowarn -d out

3. Run TestCases

java -jar junit-platform-console-standalone-1.4.0.jar --class-path out --scan-class-path

Results

╷
├─ JUnit Jupiter ✔
│  └─ BowlingGameTest ✔
│     ├─ testOneStrike() ✔
│     ├─ testAllFives() ✔
│     ├─ testAllZeros() ✔
│     ├─ testOneSpare() ✔
│     ├─ testAlternativesStrikeSpare() ✔
│     ├─ testAllStrikes() ✔
│     ├─ testAllNinesAndMisses() ✔
│     ├─ testAllSpares() ✔
│     ├─ testFinalStrike() ✔
│     ├─ testAlternativesSpareStrike() ✔
│     └─ testFinalSpare() ✔
└─ JUnit Vintage ✔

Test run finished after 76 ms
[         3 containers found      ]
[         0 containers skipped    ]
[         3 containers started    ]
[         0 containers aborted    ]
[         3 containers successful ]
[         0 containers failed     ]
[        11 tests found           ]
[         0 tests skipped         ]
[        11 tests started         ]
[         0 tests aborted         ]
[        11 tests successful      ]
[         0 tests failed          ]

How to create a TestCase

A TestCase can be generated from here

bowlinggame's People

Contributors

chipbk10 avatar

Stargazers

Matthew Barr avatar

Watchers

 avatar James Cloos avatar

Forkers

leetcode-notes

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.