GithubHelp home page GithubHelp logo

kikecancode / java-calculator-exercise Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cbfacademy/java-calculator-exercise

0.0 0.0 0.0 137 KB

An exercise project to practice writing JUnit 5 tests.

License: MIT License

Java 100.00%

java-calculator-exercise's Introduction

The Calculator

Java Language JVM Platform JUnit5 Testing Framework Maven Dependency Manager

A simple project to practice writing JUnit 5 tests.

This short guide describes:

Prerequisites

This starter project uses the Java programming language.

Before getting started, ensure you have Java 17 LTS (or higher) installed locally. The following commands should output the version of Java installed.

$ javac -version

javac 17.0.4
$ java -version

openjdk version "17.0.4" 2022-07-19 LTS
OpenJDK Runtime Environment Zulu17.36+13-CA (build 17.0.4+8-LTS)
OpenJDK 64-Bit Server VM Zulu17.36+13-CA (build 17.0.4+8-LTS, mixed mode, sharing)

Development Setup

Clone this repository locally, then create a branch to work on.

git clone [email protected]:CodingBlackFemales/the-calculator.git
cd the-calculator
git checkout -b ${your-branch-name}

Install dependencies

Next, install the project dependencies and validate your project by running the following command at the root of your project:

./mvnw clean validate

If you are on a Windows machine, that will be:

mvnw clean validate

You should see the following console output:

$ ./mvnw clean validate

[INFO] Scanning for projects...
[INFO] 
[INFO] --------------< com.codingblackfemales:the-calculator >-----------------
[INFO] Building the-calculator 1.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.2.0:clean (default-clean) @ the-calculator ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.155 s
[INFO] Finished at: 2022-11-03T20:56:09Z
[INFO] ------------------------------------------------------------------------

Practice

Exercise 1

Write tests to ensure the Calculator can multiply two numbers.
Think of all possible scenarios, and write a test for each of the scenarios.

Exercise 2

Write tests to ensure the Calculator can divide two numbers.
Think of all possible scenarios, and write a test for each of the scenarios.
One of the scenarios should encover a flaw in the Calculator implementation.

Exercise 3

Add more scenarios to cover the Calculator’s addition and subtraction functionalities.

Enjoy working on your exercise! 😃

java-calculator-exercise's People

Contributors

kikecancode avatar solangeug 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.