Skip to content

Commit

Permalink
Apply magicAssert to HintAssertions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sloy committed Dec 18, 2017
1 parent 47e4f77 commit 5ffefe0
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@ package com.schibsted.spain.barista.assertion

import android.support.annotation.IdRes
import android.support.annotation.StringRes
import android.support.test.espresso.Espresso.onView
import android.support.test.espresso.assertion.ViewAssertions.matches
import android.support.test.espresso.matcher.ViewMatchers.withHint
import android.support.test.espresso.matcher.ViewMatchers.withId
import com.schibsted.spain.barista.internal.magicAssert

object BaristaHintAssertions {

@JvmStatic
fun assertHint(@IdRes id: Int, @StringRes text: Int) {
onView(withId(id)).check(matches(withHint(text)))
fun assertHint(@IdRes viewId: Int, @StringRes text: Int) {
withId(viewId) magicAssert withHint(text)
}

@JvmStatic
fun assertHint(@IdRes id: Int, text: String) {
onView(withId(id)).check(matches(withHint(text)))
fun assertHint(@IdRes viewId: Int, text: String) {
withId(viewId) magicAssert withHint(text)
}

}

0 comments on commit 5ffefe0

Please sign in to comment.