0
今日私はTDDを練習しています。 [TestCase]または[TestCaseSource]属性を使用して、不十分なテスト機能を簡素化したいと考えています。私を助けてください。これは今私の機能ですNUNITの[TestCase]または[TestCaseSource]を使用して、構造体パラメータをテスト関数に渡す方法
[Test]
public void GetLength_TEST_1()
{
double output = Program.GetLength(new Point { x = 1, y = 2 }, new Point { x = 7, y = 8 });
output *= 1000;
output = Math.Truncate(output);
output /= 1000;
Assert.AreEqual(8.485, output);
}
[Test]
public void GetLength_TEST_2()
{
double output = Program.GetLength(new Point { x = 2, y = 7 }, new Point { x = -8, y = -6 });
output *= 1000;
output = Math.Truncate(output);
output /= 1000;
Assert.AreEqual(16.401, output);
}