You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AndroidListenerExamples/src/androidTest/java/com/designatednerd/androidlistenerexamples/test/ParameterTestExample.java
+33-7
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,26 @@
14
14
/**
15
15
* Created by ellen on 5/19/15.
16
16
*/
17
+
//Needs RunWith annotation since it's using a more specific runner.
17
18
@RunWith(Parameterized.class)
18
19
publicclassParameterTestExample {
19
20
21
+
/*******************
22
+
* PARAMETER SETUP *
23
+
*******************/
24
+
25
+
/**
26
+
* Create an iterable of object arrays that can be handed over to the test
27
+
* as parameters to the constructor.
28
+
*
29
+
* For example, here we have a constructor that takes 3 items: The first string,
30
+
* the second string, and the expected overlap string. Each of these arrays
31
+
* of strings will be passed in to the constructor in that order.
32
+
*/
20
33
@Parameters
21
34
publicstaticIterable<Object[]> data() {
22
35
returnArrays.asList(newObject[][] {
23
-
{ "cat", "rat", "at" }, //Returns in order
36
+
{ "cat", "eta", "at" }, //Returns in order of first string
24
37
{ "dog", "pug", "g"}, //Single letter
25
38
{ "bob", "steve", null }, //No letters
26
39
{ "mary", "roger", "r"}, //Many of one letter
@@ -30,24 +43,37 @@ public static Iterable<Object[]> data() {
30
43
});
31
44
}
32
45
33
-
/**
34
-
* Create your object and the things you're passing it.
35
-
*/
46
+
47
+
/*************
48
+
* VARIABLES *
49
+
*************/
50
+
36
51
privateStringmFirstString;
37
52
privateStringmSecondString;
38
53
privateStringmExpectedCommonLetters;
39
54
privateCommonLetterFindermLetterFinder;
40
55
56
+
/***************
57
+
* CONSTRUCTOR *
58
+
***************/
59
+
60
+
/**
61
+
* Test constructor that takes the params defined above.
62
+
* @param aFirstString The first string to compare.
63
+
* @param aSecondString The second string to compare.
64
+
* @param aCommonLetters The expected common letters in the string.
0 commit comments