{
IntegerList list = new IntegerList();
list.Add(5);
list.Add(10);
string t = list.ToString();
Assertion.AssertEquals("5, 10", t.ToString());
}
失败了,没关系。以下代码可以使其通过:
public override string ToString()
{
string[] items = new string[elements.Length];
for (int index = 0; index < elements.Length; index++)
{
items[index] = elements[index].ToString();
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/