public void ContinuedFractionsShouldReturnValueAsZeroIfDenominatorIsBiggerThanNumerator(int numerator, int denominator)
        {
            ContinuedFractions cf = new ContinuedFractions();

            (int, int, int)value = cf.findNext(numerator, denominator);
            Assert.Equal(0, value.Item1);
        }
        public void ContinuedFractionsShouldReturnValueAsNumeratorIfDenominatorIsOne(int numerator, int denominator)
        {
            ContinuedFractions cf = new ContinuedFractions();

            (int, int, int)value = cf.findNext(numerator, denominator);
            Assert.Equal((numerator, 0, 0), value);
        }
        public void ContinuedFractionsShouldReturnValueOfZeroToNumeratorAndNewValuesAsZero(int numerator, int denominator)
        {
            ContinuedFractions cf = new ContinuedFractions();

            (int, int, int)value = cf.findNext(numerator, denominator);
            Assert.Equal((0, 0, 0), value);
        }
        public void ContinuedFractionsShouldThrowErrorWhenDenominatorIsZeroOrLess(int numerator, int denominator)
        {
            ContinuedFractions cf  = new ContinuedFractions();
            Action             act = () => cf.findNext(numerator, denominator);

            Assert.Throws <ArgumentException>(act);
        }
        public void ContinuedFractionsShouldReturnCorrectNextValues(int numerator, int denominator)
        {
            ContinuedFractions cf = new ContinuedFractions();

            (int, int, int)value = cf.findNext(numerator, denominator);
            int gcd = new GreatestCommonDenominator().findGCD(denominator, numerator % denominator);

            Assert.Equal((numerator / denominator, denominator / gcd, (numerator % denominator) / gcd), value);
        }
 public Factoriser()
 {
     gcd = new GreatestCommonDenominator();
     cf  = new ContinuedFractions();
 }