public void TestJoin() { Assert.Equal("1,2,3", String.Join(new List<int> {1, 2, 3})); Assert.Equal("'1','2','3'", String.Join(new List<int> {1, 2, 3}, "'")); Assert.Equal("123", String.Join(new List<int> {1, 2, 3}, "", "")); Assert.Equal("\"1\",\"2\",\"3\"", String.Join(new List<int> {1, 2, 3}, "\"")); Assert.Equal("1 2 3", String.Join(new List<int> {1, 2, 3}, "", " ")); Assert.Equal("1;2;3", String.Join(new List<int> {1, 2, 3}, "", ";")); Assert.Equal("1,2,3", String.Join(new List<string> {"1", "2", "3"})); Assert.Equal("'1','2','3'", String.Join(new List<string> {"1", "2", "3"}, "'")); var list = new List<Guid> { new Guid("83B0233C-A24F-49FD-8083-1337209EBC9A"), new Guid("EAB523C6-2FE7-47BE-89D5-C6D440C3033A") }; Assert.Equal("83B0233C-A24F-49FD-8083-1337209EBC9A,EAB523C6-2FE7-47BE-89D5-C6D440C3033A".ToLower(), String.Join(list)); Assert.Equal("'83B0233C-A24F-49FD-8083-1337209EBC9A','EAB523C6-2FE7-47BE-89D5-C6D440C3033A'".ToLower(), String.Join(list, "'")); }
public void TestPinYin(string input, string result) { Assert.Equal(result, String.PinYin(input)); }
public void TestFirstLowerCase(string value, string result) { Assert.Equal(result, String.FirstLowerCase(value)); }
/// <summary> /// 测试初始化 /// </summary> public StringTest() { Builder = new String(); }