public class ViewAsserts extends Object
Modifier and Type | Method and Description |
---|---|
static void |
assertBaselineAligned(View first,
View second)
Assert that two views are aligned on their baseline, that is that their baselines
are on the same y location.
|
static void |
assertBottomAligned(View first,
View second)
Assert that two views are bottom aligned, that is that their bottom edges
are on the same y location.
|
static void |
assertBottomAligned(View first,
View second,
int margin)
Assert that two views are bottom aligned, that is that their bottom edges
are on the same y location, with respect to the specified margin.
|
static void |
assertGroupContains(ViewGroup parent,
View child)
Assert that the specified group contains a specific child once and only once.
|
static void |
assertGroupIntegrity(ViewGroup parent)
Assert the specified group's integrity.
|
static void |
assertGroupNotContains(ViewGroup parent,
View child)
Assert that the specified group does not contain a specific child.
|
static void |
assertHasScreenCoordinates(View origin,
View view,
int x,
int y)
Assert that a view has a particular x and y position on the visible screen.
|
static void |
assertHorizontalCenterAligned(View reference,
View test)
Assert that the
test view is horizontally center aligned
with respect to the reference view. |
static void |
assertLeftAligned(View first,
View second)
Assert that two views are left aligned, that is that their left edges
are on the same x location.
|
static void |
assertLeftAligned(View first,
View second,
int margin)
Assert that two views are left aligned, that is that their left edges
are on the same x location, with respect to the specified margin.
|
static void |
assertOffScreenAbove(View origin,
View view)
Assert that view is above the visible screen.
|
static void |
assertOffScreenBelow(View origin,
View view)
Assert that view is below the visible screen.
|
static void |
assertOnScreen(View origin,
View view)
Assert that view is on the screen.
|
static void |
assertRightAligned(View first,
View second)
Assert that two views are right aligned, that is that their right edges
are on the same x location.
|
static void |
assertRightAligned(View first,
View second,
int margin)
Assert that two views are right aligned, that is that their right edges
are on the same x location, with respect to the specified margin.
|
static void |
assertTopAligned(View first,
View second)
Assert that two views are top aligned, that is that their top edges
are on the same y location.
|
static void |
assertTopAligned(View first,
View second,
int margin)
Assert that two views are top aligned, that is that their top edges
are on the same y location, with respect to the specified margin.
|
static void |
assertVerticalCenterAligned(View reference,
View test)
Assert that the
test view is vertically center aligned
with respect to the reference view. |
public static void assertOnScreen(View origin, View view)
origin
- The root view of the screen.view
- The view.public static void assertOffScreenBelow(View origin, View view)
origin
- The root view of the screen.view
- The viewpublic static void assertOffScreenAbove(View origin, View view)
origin
- Te root view of the screen.view
- The viewpublic static void assertHasScreenCoordinates(View origin, View view, int x, int y)
origin
- The root view of the screen.view
- The view.x
- The expected x coordinate.y
- The expected y coordinate.public static void assertBaselineAligned(View first, View second)
first
- The first viewsecond
- The second viewpublic static void assertRightAligned(View first, View second)
first
- The first viewsecond
- The second viewpublic static void assertRightAligned(View first, View second, int margin)
first
- The first viewsecond
- The second viewmargin
- The margin between the first view and the second viewpublic static void assertLeftAligned(View first, View second)
first
- The first viewsecond
- The second viewpublic static void assertLeftAligned(View first, View second, int margin)
first
- The first viewsecond
- The second viewmargin
- The margin between the first view and the second viewpublic static void assertBottomAligned(View first, View second)
first
- The first viewsecond
- The second viewpublic static void assertBottomAligned(View first, View second, int margin)
first
- The first viewsecond
- The second viewmargin
- The margin between the first view and the second viewpublic static void assertTopAligned(View first, View second)
first
- The first viewsecond
- The second viewpublic static void assertTopAligned(View first, View second, int margin)
first
- The first viewsecond
- The second viewmargin
- The margin between the first view and the second viewpublic static void assertHorizontalCenterAligned(View reference, View test)
test
view is horizontally center aligned
with respect to the reference
view.reference
- The reference viewtest
- The view that should be center aligned with the reference viewpublic static void assertVerticalCenterAligned(View reference, View test)
test
view is vertically center aligned
with respect to the reference
view.reference
- The reference viewtest
- The view that should be center aligned with the reference viewpublic static void assertGroupIntegrity(ViewGroup parent)
parent
- The group whose integrity to checkpublic static void assertGroupContains(ViewGroup parent, View child)
parent
- The groupchild
- The child that should belong to group