forked from task032015/stringProblem
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestReplaceString.java
More file actions
33 lines (28 loc) · 973 Bytes
/
Copy pathTestReplaceString.java
File metadata and controls
33 lines (28 loc) · 973 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
package com.apple.ReplaceString;
import org.testng.annotations.Test;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
public class TestReplaceString {
@Test(dataProvider="getData")
public void testremoveChar(String s, char c, String actual){
Assert.assertEquals(ReplaceString.removeChar(s, c), actual);
}
@Test(dataProvider="getData")
public void testremoveCharMethod(String st, char c, String actual){
Assert.assertEquals(ReplaceString.removeCharMethod(st, ch), actual);
}
@DataProvider()
public Object[][] getData(){
Object data[][] = new Object[][];
data[][]={
{ "jdadva", 'd', "java" },
{ "djdava", 'd', "java" },
{null, 'd', null},//null String as input
{ "", 'd', "" },//empty string as input
{ "#6$a#", '#', "6$a" },//String with special characters and numericals
{ "123456", '5', "12346" },//String with numericals
{ "ja v a", ' ', "java" }//String with spaces as input
};
return data;
}
}