単体テストクラスに3つのテストメソッドがありますが、Visual Studioは2番目のテストのみを実行し、他のテストは無視します
これらは3つのテスト方法です:
[TestClass()]
public class InsertionSortTest
{
[TestMethod()]
public void sortTest()
{
InsertionSort target = new InsertionSort(); // TODO: Initialize to an appropriate value
int[] n = new int[] { 2, 1, 4 };
int[] nExpected = new int[] { 1, 2, 4 };
target.sort(ref n);
CollectionAssert.AreEqual(nExpected, n);
}
[TestMethod()]
public void sortTest2()
{
InsertionSort target = new InsertionSort(); // TODO: Initialize to an appropriate value
int[] n = new int[] { 1, 2 };
int[] nExpected = new int[] { 1, 2 };
target.sort(ref n);
CollectionAssert.AreEqual(nExpected, n);
}
[TestMethod()]
public void sortTest3()
{
InsertionSort target = new InsertionSort(); // TODO: Initialize to an appropriate value
int[] n = new int[] { 1, 2 };
int[] nExpected = new int[] { 1, 2 };
target.sort(ref n);
CollectionAssert.AreEqual(nExpected, n);
}
}
では、テストを実行すると、sortTest2のみが実行されますか?これから3つの結果を期待しています。結果1/1に合格しています。TestName:sortTest2。
私が行った他の2つのテストはどうなりましたか?