Giter VIP home page Giter VIP logo

kotlin-test-boilerplate's Introduction

KotlinTestBoilerplate

Welcome! This Plugin reduce your time that waste by write test code. We provide some kind of patterns that is you often used

You must install kotest and mockk library in your project, Currently, we support only kotest and mockk

Currently, This Plugin is beta version!

Overview

It's very convenient tool. it can create test boilerplate. It's easily accessible, we provide shortcut keymap cmd + shift + t that you used to create test classes.

Easy to create unit test

Generally, we mock every property that be injected by other when we create unit-test.

BehaviourSpec & FunSpec

BehaviourSpec

FreeSpec

FunSpec

  • you should check method mock check box if you want to get method name for test

Features

Version[0.0.1]

  • Unit Test Boiler Plate
  • Support FunSpec, Behaviour Spec, FreeSpec
  • Auto Mocking Properties which is contained specific class
  • Bug fix

Version[0.0.2]

Contributes

Unfortunately, you can't contribute at this time. This Plugin need time to stabilize. But, you can contribute to some pattern that used to create some test code We want to be in a state where we can get other people's contributions as soon as possible.

Report TestBoilerPlate pattern

If you want to report some pattern that you are frequently used when creating a test class, then Follow the process below

  1. [Issue] - [New Issue]
  2. Write title ("My Unit Test Boiler Plate Pattern ...")
  3. Write sudo code by kotlin styles.
// This is not test class
@Service
class OrderService(private val repository: OrderRepsoitory) {
    
    fun order() {
        // doSome ...
    }
    
}

// This is test class that be made by kotlin-boilerplate plugins
class OrderServiceTestClass : FunSpec({
    
    val mockRepository: OrderRepsoitory = mock<>(relaxed = true)
    // SUT
    val orderService = OrderService(mockRepository)
})

kotlin-test-boilerplate's People

Contributors

tmdgusya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

kotlin-test-boilerplate's Issues

Create Code Parser

현재 코드를 분석하는 클래스를 만든다.

책임

  • Get Properties of Constructor
    • Get Type of property
    • Get Name of property
  • Get ClassName

Add Detekt

use detekt

  • improve code quality
  • set code rules

New BoilerPlate Template [FreeSpec]

class OriginalClass(private val mock: MockingClass) {
    fun doSomething() { ... }
}


class OriginalClassTest : FreeSpec({
    "doSomething" - {

   }
})

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.