forked from task032015/stringProblem
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringProblemTest.java
More file actions
38 lines (26 loc) · 923 Bytes
/
Copy pathStringProblemTest.java
File metadata and controls
38 lines (26 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package iappsqainterview;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
public class StringProblemTest {
@Test(dataProvider = "getData")
public static void testStringProblem(String str,char ch,String expectedVal) {
String actualResult = StringProblem.removeCharFromString(str,ch);
Assert.assertEquals(actualResult, expectedVal);
}
@Test(dataProvider = "getData")
public static void testStringProblem1(String str,char ch,String expectedVal) {
String actualResult = StringProblem.removeCharFromString1(str,ch);
Assert.assertEquals(actualResult, expectedVal);
}
@DataProvider(name = "getData")
public static Object[][] getData() {
return new Object[][] {
{"Anitha",'a',"Anith"},
{"Murthy",'x',"Murthy"},
{"nnnnnnn",'n',""},
{null,'x',null},
{"xabcdx",'x',"abcd"},
};
}
}