Example #1
0
        public void CanFindDigitsOfANumber(int number, int[] expected)
        {
            var sut = new MathUtil();
            var actual = sut.GetDigits(number);

            Assert.Equal(expected, actual);
        }
Example #2
0
        public void ShouldFindSumOfDivisorsForNumber(int expected, int number)
        {
            var sut = new MathUtil();
            var actual = sut.GetSumOfDivisors(number);

            Assert.Equal(expected, actual);
        }
Example #3
0
 public AbundantSum(MathUtil mathUtil)
 {
     this._mathUtil = mathUtil;
 }
Example #4
0
 public PalindromeFinder(MathUtil mathUtil)
 {
     this._mathUtil = mathUtil;
 }
 public LexicographicPermutation(MathUtil mathUtil)
 {
     this._mathUtil = mathUtil;
 }
Example #6
0
 public DigitPowerFinder(MathUtil mathUtil)
 {
     this._mathUtil = mathUtil;
 }
Example #7
0
 public AmicableNumberFinder(MathUtil util)
 {
     this._mathUtil = util;
 }
Example #8
0
 public ReciprocalCycle(PrimeFactorFinder primeFactorFinder)
 {
     this._primeFactorFinder = primeFactorFinder;
     this._mathUtil = new MathUtil();
 }