Esempio n. 1
0
        public void CalculateGcdByEuclideanAlgorithmWithZeroShouldReturnActualGcd()
        {
            EuclideanAlgorithm euclidean = new EuclideanAlgorithm();

            Assert.AreEqual(13, euclidean.CalculateGcd(0, 13));
        }
Esempio n. 2
0
        public void CalculateGcdByEuclideanAlgorithmShouldReturnActualGcd()
        {
            EuclideanAlgorithm euclidean = new EuclideanAlgorithm();

            Assert.AreEqual(2, euclidean.CalculateGcd(10, 12));
        }
Esempio n. 3
0
        public void CalculateGcdByEuclideanAlgorithmWithNegativeArgument()
        {
            EuclideanAlgorithm euclidean = new EuclideanAlgorithm();

            Assert.AreEqual(6, euclidean.CalculateGcd(24, -6));
        }
Esempio n. 4
0
        public void CalculateGcdByEuclideanAlgorithmWithZeroesArgument()
        {
            EuclideanAlgorithm binary = new EuclideanAlgorithm();

            Assert.AreEqual(0, binary.CalculateGcd(0, 0));
        }
Esempio n. 5
0
        public void CalculateGcdByEuclideanAlgorithmShouldReturnOne()
        {
            EuclideanAlgorithm euclidean = new EuclideanAlgorithm();

            Assert.AreEqual(1, euclidean.CalculateGcd(1, 13));
        }