내 메서드에 대한 단위 테스트를 만들려고하고 있으며 구성을 올바르게 수행 할 수 없습니다. 새 테스트 -> 유닛 테스트 마법사 -> 내 방법 선택 -> 테스트 메소드 값 채우기를 수행하지만 항상 Assert.Inclusclusive가 실패합니다. 이 테스트 방법의 정확성을 확인하십시오.visual studio 2010 C# unit tests
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
}
public int Mult(int a, int b)
{
return a * b;
}
}
}
및 시험 방법 : 여기
은 샘플 방법이다[TestMethod()]
public void MultTest()
{
Program target = new Program(); // TODO: Initialize to an appropriate value
int a = 4; // TODO: Initialize to an appropriate value
int b = 5; // TODO: Initialize to an appropriate value
int expected = 20; // TODO: Initialize to an appropriate value
int actual;
actual = target.Mult(a, b);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
똑바로 앞으로 충분한 것 같다,하지만 난 사소한 뭔가를 놓친 거지?
그 라인을 꺼낼 때 올바르게 실행되는 것으로 생각했습니다. 감사. –