按单词元音数升序写出文本的每个句子。错误:没有任何"字母"的重载。方法接受参数"1"
public class Vowels
{
public string Letters()
{
string[] a = { "aeiouy" };
Array.Sort(a);
}
}
单元测试:
[TestClass]
public class VowelsTests
{
[TestMethod]
public void MethodSort_vowels_in_ascending_order()
{
string a = "Teest! Test!";
string expected = "Test! Teest";
Vowels t = new Vowels();
int actual = t.Letters(a);
Assert.AreEqual(expected, actual);
}
}
您正在调用带有参数(t.Letters(a)
)的方法Letters()
,但它没有定义任何参数(public string Letters() {}
)。