Skip to content

Commit

Permalink
- renamed resources - added prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
vokod committed May 15, 2019
1 parent 3f7667b commit 40bb4fa
Show file tree
Hide file tree
Showing 28 changed files with 186 additions and 210 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,34 @@ class ButtonSettingAttributesTests {

@Test
fun test_titleText_SetFromAttributes() {
onView(withId(R.id.tv_title)).check(matches(withText(R.string.test_title)))
onView(withId(R.id.tv_title)).check(matches(withText(R.string.SettingViews_test_title)))
}

@Test
fun test_Description_TextSetFromAttributes() {
onView(withId(R.id.tv_desc)).check(matches(withText(R.string.test_description)))
onView(withId(R.id.tv_desc)).check(matches(withText(R.string.SettingViews_test_description)))
}

@Test
fun test_TitleColor_SetFromAttributes() {
onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.test_text_title, activityRule.activity.resources)))
onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.color_SettingViews_test_text_title, activityRule.activity.resources)))
}

@Test
fun test_DescriptionColor_SetFromAttributes() {
onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.test_text_description, activityRule.activity.resources)))
onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.color_SettingViews_test_text_description, activityRule.activity.resources)))
}

@Test
fun test_DisabledTitleColor_SetFromAttribute() {
activityRule.runOnUiThread { activityRule.activity.bs.isEnabled = false }
onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.test_text_disabled, activityRule.activity.resources)))
onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources)))
}

@Test
fun test_DisabledDescriptionColor_SetFromAttribute() {
activityRule.runOnUiThread { activityRule.activity.bs.isEnabled = false }
onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.test_text_disabled, activityRule.activity.resources)))
onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources)))
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ButtonSettingDefaultValuesTests {
Espresso.onView(ViewMatchers.withId(R.id.tv_title)).check(
ViewAssertions.matches(
TextColorMatcher.withTextColor(
R.color.text_title,
R.color.color_SettingViews_text_title,
activityRule.activity.resources
)
)
Expand All @@ -53,7 +53,7 @@ class ButtonSettingDefaultValuesTests {
Espresso.onView(ViewMatchers.withId(R.id.tv_desc)).check(
ViewAssertions.matches(
TextColorMatcher.withTextColor(
R.color.text_description,
R.color.color_SettingViews_text_description,
activityRule.activity.resources
)
)
Expand Down Expand Up @@ -84,7 +84,7 @@ class ButtonSettingDefaultValuesTests {
Espresso.onView(ViewMatchers.withId(R.id.tv_title)).check(
ViewAssertions.matches(
TextColorMatcher.withTextColor(
R.color.text_disabled,
R.color.color_SettingViews_text_disabled,
activityRule.activity.resources
)
)
Expand All @@ -97,7 +97,7 @@ class ButtonSettingDefaultValuesTests {
Espresso.onView(ViewMatchers.withId(R.id.tv_desc)).check(
ViewAssertions.matches(
TextColorMatcher.withTextColor(
R.color.text_disabled,
R.color.color_SettingViews_text_disabled,
activityRule.activity.resources
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import org.junit.Test
import org.junit.runner.RunWith
import com.awolity.settingviews.TextColorMatcher.withTextColor
import kotlinx.android.synthetic.main.activity_mock_defaults_bs.*
import org.hamcrest.CoreMatchers.not
import java.lang.IllegalStateException

@RunWith(AndroidJUnit4::class)
class ButtonSettingSaveStateTests {
Expand All @@ -41,13 +39,13 @@ class ButtonSettingSaveStateTests {
@Test
fun setTitleColor_Rotate_lookTitleColor() {
activityRule.runOnUiThread {
activityRule.activity.bs.setTitleTextColor(activityRule.activity.getColor(R.color.test_text_title))
activityRule.activity.bs.setTitleTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_title))
rotate()
}
onView(withId(R.id.tv_title)).check(
matches(
withTextColor(
R.color.test_text_title,
R.color.color_SettingViews_test_text_title,
activityRule.activity.resources
)
)
Expand All @@ -66,13 +64,13 @@ class ButtonSettingSaveStateTests {
@Test
fun setDescriptionColor_Rotate_lookDescriptionColor() {
activityRule.runOnUiThread {
activityRule.activity.bs.setDescriptionTextColor(activityRule.activity.getColor(R.color.test_text_description))
activityRule.activity.bs.setDescriptionTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_description))
rotate()
}
onView(withId(R.id.tv_desc)).check(
matches(
withTextColor(
R.color.test_text_description,
R.color.color_SettingViews_test_text_description,
activityRule.activity.resources
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import org.junit.runner.RunWith
import com.awolity.settingviews.TextColorMatcher.withTextColor
import kotlinx.android.synthetic.main.activity_mock_defaults_bs.*
import org.hamcrest.CoreMatchers.not
import java.lang.IllegalStateException

// TODO: checkable teszt (ha chekable, akkor a checkable-iv-nek kell a hely

Expand Down Expand Up @@ -44,7 +43,7 @@ class ButtonSettingSetFromCodeTests {
onView(withId(R.id.tv_title)).check(
matches(
withTextColor(
R.color.text_disabled,
R.color.color_SettingViews_text_disabled,
activityRule.activity.resources
)
)
Expand All @@ -57,7 +56,7 @@ class ButtonSettingSetFromCodeTests {
onView(withId(R.id.tv_desc)).check(
matches(
withTextColor(
R.color.text_disabled,
R.color.color_SettingViews_text_disabled,
activityRule.activity.resources
)
)
Expand All @@ -79,7 +78,7 @@ class ButtonSettingSetFromCodeTests {
activityRule.activity.bs.isEnabled = false
activityRule.activity.bs.isEnabled = true
}
onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.text_title, activityRule.activity.resources)))
onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.color_SettingViews_text_title, activityRule.activity.resources)))
}

@Test
Expand All @@ -91,7 +90,7 @@ class ButtonSettingSetFromCodeTests {
onView(withId(R.id.tv_desc)).check(
matches(
withTextColor(
R.color.text_description,
R.color.color_SettingViews_text_description,
activityRule.activity.resources
)
)
Expand Down Expand Up @@ -119,13 +118,13 @@ class ButtonSettingSetFromCodeTests {
@Test
fun setTitleColor_lookTitleColor() {
activityRule.runOnUiThread {
activityRule.activity.bs.setTitleTextColor(activityRule.activity.getColor(R.color.test_text_title))
activityRule.activity.bs.setTitleTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_title))
activityRule.activity.bs.setTitle(title)
}
onView(withId(R.id.tv_title)).check(
matches(
withTextColor(
R.color.test_text_title,
R.color.color_SettingViews_test_text_title,
activityRule.activity.resources
)
)
Expand All @@ -135,13 +134,13 @@ class ButtonSettingSetFromCodeTests {
@Test
fun setDescriptionColor_lookDescriptionColor() {
activityRule.runOnUiThread {
activityRule.activity.bs.setDescriptionTextColor(activityRule.activity.getColor(R.color.test_text_description))
activityRule.activity.bs.setDescriptionTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_description))
activityRule.activity.bs.setDescription(description)
}
onView(withId(R.id.tv_desc)).check(
matches(
withTextColor(
R.color.test_text_description,
R.color.color_SettingViews_test_text_description,
activityRule.activity.resources
)
)
Expand All @@ -153,12 +152,12 @@ class ButtonSettingSetFromCodeTests {
activityRule.runOnUiThread {
activityRule.activity.bs.setTitle(title)
activityRule.activity.bs.isEnabled = false
activityRule.activity.bs.setDisabledTextColor(activityRule.activity.getColor(R.color.test_text_disabled))
activityRule.activity.bs.setDisabledTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_disabled))
}
onView(withId(R.id.tv_title)).check(
matches(
withTextColor(
R.color.test_text_disabled,
R.color.color_SettingViews_test_text_disabled,
activityRule.activity.resources
)
)
Expand All @@ -168,14 +167,14 @@ class ButtonSettingSetFromCodeTests {
@Test
fun setDisabledColorDescription_lookDisabledColorDescription() {
activityRule.runOnUiThread {
activityRule.activity.bs.setDisabledTextColor(activityRule.activity.getColor(R.color.test_text_disabled))
activityRule.activity.bs.setDisabledTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_disabled))
activityRule.activity.bs.isEnabled = false
activityRule.activity.bs.setDescription(description)
}
onView(withId(R.id.tv_desc)).check(
matches(
withTextColor(
R.color.test_text_disabled,
R.color.color_SettingViews_test_text_disabled,
activityRule.activity.resources
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,51 +30,51 @@ class RadiogroupSettingAttributesTests {

@Test
fun test_titleText_SetFromAttributes() {
onView(withId(R.id.tv_title)).check(matches(withText(R.string.test_title)))
onView(withId(R.id.tv_title)).check(matches(withText(R.string.SettingViews_test_title)))
}

@Test
fun test_Description_TextSetFromAttributes() {
onView(withId(R.id.tv_desc)).check(matches(withText(R.string.test_description)))
onView(withId(R.id.tv_desc)).check(matches(withText(R.string.SettingViews_test_description)))
}

@Test
fun test_Radiobutton1Label_TextSetFromAttributes() {
onView(withId(R.id.rb_one)).check(matches(withText(R.string.test_text_1)))
onView(withId(R.id.rb_one)).check(matches(withText(R.string.SettingViews_test_text_1)))
}

@Test
fun test_Radiobutton2Label_TextSetFromAttributes() {
onView(withId(R.id.rb_two)).check(matches(withText(R.string.test_text_2)))
onView(withId(R.id.rb_two)).check(matches(withText(R.string.SettingViews_test_text_2)))
}

@Test
fun test_TitleColor_SetFromAttributes() {
onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.test_text_title, activityRule.activity.resources)))
onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.color_SettingViews_test_text_title, activityRule.activity.resources)))
}

@Test
fun test_DescriptionColor_SetFromAttributes() {
onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.test_text_description, activityRule.activity.resources)))
onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.color_SettingViews_test_text_description, activityRule.activity.resources)))
}

@Test
fun test_DisabledTitleColor_SetFromAttribute() {
activityRule.runOnUiThread { activityRule.activity.rs.isEnabled = false }
onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.test_text_disabled, activityRule.activity.resources)))
onView(withId(R.id.tv_title)).check(matches(withTextColor(R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources)))
}

@Test
fun test_DisabledDescriptionColor_SetFromAttribute() {
activityRule.runOnUiThread { activityRule.activity.rs.isEnabled = false }
onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.test_text_disabled, activityRule.activity.resources)))
onView(withId(R.id.tv_desc)).check(matches(withTextColor(R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources)))
}

@Test
fun test_DisabledRadioButtonLabelColor_SetFromAttribute() {
activityRule.runOnUiThread { activityRule.activity.rs.isEnabled = false }
onView(withId(R.id.rb_one)).check(matches(withTextColor(R.color.test_text_disabled, activityRule.activity.resources)))
onView(withId(R.id.rb_two)).check(matches(withTextColor(R.color.test_text_disabled, activityRule.activity.resources)))
onView(withId(R.id.rb_one)).check(matches(withTextColor(R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources)))
onView(withId(R.id.rb_two)).check(matches(withTextColor(R.color.color_SettingViews_test_text_disabled, activityRule.activity.resources)))
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class RadiogroupSettingDefaultValuesTests {
onView(withId(R.id.tv_title)).check(
matches(
TextColorMatcher.withTextColor(
R.color.text_title,
R.color.color_SettingViews_text_title,
activityRule.activity.resources
)
)
Expand All @@ -62,7 +62,7 @@ class RadiogroupSettingDefaultValuesTests {
onView(withId(R.id.rb_one)).check(
matches(
TextColorMatcher.withTextColor(
R.color.text_description,
R.color.color_SettingViews_text_description,
activityRule.activity.resources
)
)
Expand Down Expand Up @@ -92,7 +92,7 @@ class RadiogroupSettingDefaultValuesTests {
onView(withId(R.id.tv_desc)).check(
matches(
TextColorMatcher.withTextColor(
R.color.text_description,
R.color.color_SettingViews_text_description,
activityRule.activity.resources
)
)
Expand All @@ -111,7 +111,7 @@ class RadiogroupSettingDefaultValuesTests {
onView(withId(R.id.tv_title)).check(
matches(
TextColorMatcher.withTextColor(
R.color.text_disabled,
R.color.color_SettingViews_text_disabled,
activityRule.activity.resources
)
)
Expand All @@ -124,7 +124,7 @@ class RadiogroupSettingDefaultValuesTests {
onView(withId(R.id.tv_desc)).check(
matches(
TextColorMatcher.withTextColor(
R.color.text_disabled,
R.color.color_SettingViews_text_disabled,
activityRule.activity.resources
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import com.awolity.settingviews.TextColorMatcher.withTextColor
import kotlinx.android.synthetic.main.activity_mock_defaults_bs.*
import kotlinx.android.synthetic.main.activity_mock_defaults_rs.*
import org.hamcrest.CoreMatchers.not
import java.lang.IllegalStateException

@RunWith(AndroidJUnit4::class)
class RadiogroupSettingSaveStateTests {
Expand All @@ -43,13 +40,13 @@ class RadiogroupSettingSaveStateTests {
@Test
fun setTitleColor_Rotate_lookTitleColor() {
activityRule.runOnUiThread {
activityRule.activity.rs.setTitleTextColor(activityRule.activity.getColor(R.color.test_text_title))
activityRule.activity.rs.setTitleTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_title))
rotate()
}
onView(withId(R.id.tv_title)).check(
matches(
withTextColor(
R.color.test_text_title,
R.color.color_SettingViews_test_text_title,
activityRule.activity.resources
)
)
Expand All @@ -68,13 +65,13 @@ class RadiogroupSettingSaveStateTests {
@Test
fun setDescriptionColor_Rotate_lookDescriptionColor() {
activityRule.runOnUiThread {
activityRule.activity.rs.setDescriptionTextColor(activityRule.activity.getColor(R.color.test_text_description))
activityRule.activity.rs.setDescriptionTextColor(activityRule.activity.getColor(R.color.color_SettingViews_test_text_description))
rotate()
}
onView(withId(R.id.tv_desc)).check(
matches(
withTextColor(
R.color.test_text_description,
R.color.color_SettingViews_test_text_description,
activityRule.activity.resources
)
)
Expand Down
Loading

0 comments on commit 40bb4fa

Please sign in to comment.