コード例 #1
0
        public static void Magnitude(double x1, double y1, double x2, double y2, double expectedResult)
        {
            double xComponent = x2 - x1;
            double yComponent = y2 - y1;

            Assert.AreEqual(expectedResult, VectorLibrary.Magnitude(xComponent, yComponent), Tolerance);
        }
コード例 #2
0
 public static void Magnitude_Throws_ArgumentException_for_Zero_Magnitude()
 {
     Assert.Throws <ArgumentException>(() => VectorLibrary.Magnitude(0, 0));
 }