square / assertj-android

A set of AssertJ helpers geared toward testing Android.
https://square.github.io/assertj-android/
Apache License 2.0
1.58k stars 156 forks source link

Rename ANDROID.assertThat to ANDROID.assertThatAndroid #148

Closed mogronalol closed 9 years ago

mogronalol commented 9 years ago

If I want to use assertj and this library in one class, it would be nice if I could static import everything. So I would have along the lines of:

assertThatAndroid(textView).hasText("foo")
assertThat(someList).containsExactly("one", "two")

I just find it a little more expression that having to write:

ANDROID.assertThat(textView).hasText("foo")
assertThat(someList).containsExactly("one", "two")

Perhaps I'm being a little pedantic, but I'm wondering if this is a good idea or not? If so I can issue a pull request, or if it will be annoying as it will be a breaking change for everyone.

JakeWharton commented 9 years ago

You can static import both. On Feb 3, 2015 6:09 AM, "Andrew Morgan" notifications@github.com wrote:

If I want to use assertj and this library in one class, it would be nice if I could static import everything. So I would have along the lines of:

assertThatAndroid(textView).hasText("foo") assertThat(someList).containsExactly("one", "two")

I just find it a little more expression that having to write:

ANDROID.assertThat(textView).hasText("foo") assertThat(someList).containsExactly("one", "two")

Perhaps I'm being a little pedantic, but I'm wondering if this is a good idea or not? If so I can issue a pull request, or if it will be annoying as it will be a breaking change for everyone.

— Reply to this email directly or view it on GitHub https://github.com/square/assertj-android/issues/148.

JakeWharton commented 9 years ago
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.android.api.Assertions.assertThat;
mogronalol commented 9 years ago

For some reason my ide wasn't letting me do this with alt + enter but a manual static import is fine. Thanks.

On Tuesday, 3 February 2015, Jake Wharton notifications@github.com wrote:

Closed #148 https://github.com/square/assertj-android/issues/148.

— Reply to this email directly or view it on GitHub https://github.com/square/assertj-android/issues/148#event-229543153.