书栈网 · BookStack 本次搜索耗时 0.015 秒,为您找到 29 个相关结果.
  • Mocking

    394 2021-11-12 《MockK Guidebook》
    Mocking Mocking Mocking start with one call, the mockk function. This function takes in a class and returns a fake version of it, where all functions are present but will throw...
  • Android Quickstart

    929 2021-11-12 《MockK Guidebook》
    Android Quickstart Android Quickstart MockK works great with Android and allows you to mock objects in both your Android unit tests and instrumented tests. MockK can handle mock...
  • Coroutines and suspend functions

    631 2021-11-12 《MockK Guidebook》
    Coroutines and suspend functions Coroutines and suspend functions As MockK uses function literals to create stubs, small changes are needed to stub suspend functions. MockK prov...
  • Mock singleton objects and static methods

    327 2021-11-12 《MockK Guidebook》
    Mock singleton objects and static methods Mocking objects Mocking static methods Unmocking Mock singleton objects and static methods Mocking objects When you need a singleto...
  • void methods

    424 2021-11-12 《MockK Guidebook》
    void methods void methods Mockito’s when method doesn’t work with void methods. To create a stub that doesn’t return anything, the doNothing method is used. val mockedFile...
  • Migrating from Mockito

    335 2021-11-12 《MockK Guidebook》
    Migrating from Mockito Migrating from Mockito Learn how to use MockK by seeing equivalents to functions in Mockito . Create a mock The similarities and differences in creatin...
  • Getting Started

    492 2021-11-12 《MockK Guidebook》
    Getting Started Getting Started Why use mocks I thought lying was bad! Why MockK? (TODO) About the MockK framework.
  • argThat

    316 2021-11-12 《MockK Guidebook》
    argThat argThat The argThat argument matcher in Mockito lets you create advanced argument matchers that run a function on passed arguments, and checks if the function returns...
  • Return Unit

    323 2021-11-12 《MockK Guidebook》
    Return Unit Return Unit When stubbing a function that returns nothing, MockK provides a few shortcuts. val logger = mockk < Logger >() every { logger . log ( any ())...
  • Create more complicated answers for stubs

    439 2021-11-12 《MockK Guidebook》
    Side effects Answer scope Individual arguments All arguments Most stubs will use returns to always return the same value when the corresponding method is called. Sometimes, ...