mockitoid

Mockito mocks and asserts for android

Лицензия

Лицензия

MIT
Категории

Категории

Mockito Тестирование компонентов
Группа

Группа

de.jodamob.android
Идентификатор

Идентификатор

mockitoid
Последняя версия

Последняя версия

0.7
Дата

Дата

Тип

Тип

jar
Описание

Описание

mockitoid
Mockito mocks and asserts for android
Ссылка на сайт

Ссылка на сайт

https://github.com/dpreussler/mockitoid
Система контроля версий

Система контроля версий

https://github.com/dpreussler/mockitoid

Скачать mockitoid

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/de.jodamob.android/mockitoid/ -->
<dependency>
    <groupId>de.jodamob.android</groupId>
    <artifactId>mockitoid</artifactId>
    <version>0.7</version>
</dependency>
// https://jarcasting.com/artifacts/de.jodamob.android/mockitoid/
implementation 'de.jodamob.android:mockitoid:0.7'
// https://jarcasting.com/artifacts/de.jodamob.android/mockitoid/
implementation ("de.jodamob.android:mockitoid:0.7")
'de.jodamob.android:mockitoid:jar:0.7'
<dependency org="de.jodamob.android" name="mockitoid" rev="0.7">
  <artifact name="mockitoid" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.jodamob.android', module='mockitoid', version='0.7')
)
libraryDependencies += "de.jodamob.android" % "mockitoid" % "0.7"
[de.jodamob.android/mockitoid "0.7"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.mockito : mockito-all jar 1.9.5
com.android.support » recyclerview-v7 jar 23.2.1
com.android.support » cardview-v7 jar 23.2.1

Модули Проекта

Данный проект не имеет модулей.

Build Status Maven Central

mockitoid

Android specific assertions and mocks for mockito for cleaner test code

Gradle

testCompile 'de.jodamob.android:mockitoid:0.7'
 

Asserts

write anyActivity() instead of any(Activity.class) in mockito verification.

example:

verify(myInteractor).showWizard(anyActivity());

Same with:

anyFragment()
anyFragmentManager()
anyIntent()
anyContext()
anyView()
anyButton()
...

more to be come

Mocks

write mockActivity() instead of mock(Activity.class) Same with:

mockFragment()
mockResources()
mockContext()
mockIntent()
mockBundle()
...

some mocks can have small behavior: mockTextView("test") given a Textview that will return an Editable that has string "test"

mockFragmentManager(FragmentTransaction) will return this fragmenttransaction for every transaction started

mockRecyclerView() will return a recyclerview that will remember adapter and laoutManager between set and get

mockMenuItem(id) where id will be the itemId that will return a MenuItem mock for ..

Licensed under MIT license (c) 2015-2016 Danny Preussler

Версии библиотеки

Версия
0.7
0.6
0.5
0.2