Giter Site home page Giter Site logo

wubin28 / mocks-fakes-spies-and-stubs-kata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aleixmorgadas/mocks-fakes-spies-and-stubs-kata

0.0 1.0 0.0 129 KB

Kata to practice the usage of different test-doubles

License: MIT License

Java 100.00%

mocks-fakes-spies-and-stubs-kata's Introduction

Mocks, Fakes, Spies and Stubs Kata

Requirements

  • Java 8
  • Gradle
  • An IDE, I would suggest IntelliJ. For IntelliJ users, check that you are using the latest version

Setup Environment

  1. Clone the repository

    git clone [email protected]:aleixmp/mocks-fakes-spies-and-stubs-kata.git

  2. Check all tests are green ./gradlew test

How is the kata structured ?

  • kata.domain.film: Test-Doubles examples made with Mockito and hand-made examples.
  • kata.domain.user: Support domain to represent the UserId
  • kata.domain.rate: Actual kata.
  • kata.support: InMemoryRepositories

How to do the Kata?

  1. Check the tests at kata.domain.rate.

    You will see the RateServiceTest_<Test Double Type>. Implement each Test following the named pattern. :info: Remember that using two different Test Double types in the same test is allowed.

  2. After you implemented all tests using different Test Double types, change the implementation of RateService. The goal is to break the code and see which tests become red and which keep green. So, you notice which Test Doubles are safer when changing the implementation.

FAQ

  • Should I expect miss behaviour in the code?

No, but maybe there are bugs in the code. Feel free to open an issue or talk with me for clarification.

  • Should I only use one Test-Double type in each class?

No, it is expected that you have to use a combination of two or more test-double types to achieve the desired behaviour.

Supportive docs

mocks-fakes-spies-and-stubs-kata's People

Contributors

aleixmp avatar aleixmorgadas avatar

Watchers

 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.