public void TestMethodNOD() { TimeSpan ts = new TimeSpan(); EuclidAl a = new EuclidAl(); int expected = 2; int actual=a.NodNumb(ref ts,2,18); Assert.AreEqual(expected, actual); }
static void Main(string[] args) { EuclidAl a = new EuclidAl(); int b; int[] array = new int[5] { 44, 32, 20, 28, 16 }; int[] array2 = new int[5] { 24, 36, 12, 48, 60 }; TimeSpan ts = new TimeSpan(); b = a.NodNumb(ref ts, 20, 4); Console.Write("NOD 2 nub =" + b + " Time=" + ts + " \n"); b = a.NodNumb(ref ts, array); Console.Write("NOD array of numbers= " + b + " time=" + ts + " \n"); b = a.AlgShreina(ref ts, 44, 100); Console.Write("Algorithm Shreina 2 numberss= " + b + " time" + ts + " \n"); b = a.AlgShreina(ref ts, array2); Console.Write("Algorithm Shreina array of numbers= " + b + " time=" + ts + " \n"); Console.ReadKey(); }
public void TestMethodNodArray() { TimeSpan ts = new TimeSpan(); EuclidAl a = new EuclidAl(); int[] array = new int[5] { 44, 32, 20, 28, 16 }; int expected = 4; int actual = a.NodNumb(ref ts, array); Assert.AreEqual(expected, actual); }