public void GetFactorsAmount_MaxInt_IsPrime() //!!! 2^n-1 sometimes is prime; 2^32-1 indeed ! { var solver = new CountFactors(); var amount = solver.GetFactorsAmount(int.MaxValue); _outputHelper.WriteLine($"max int has {amount} divisors"); }
public void GetFactorsAmount_Prime_2(int n) { var solver = new CountFactors(); var amount = solver.GetFactorsAmount(n); amount.Should().Be(2); }
public void GetFactorsAmount_Composite_Many(int n, int expected) { var solver = new CountFactors(); var amount = solver.GetFactorsAmount(n); amount.Should().Be(expected); }
public void GetFactorsAmount_Small_1(int n) { var solver = new CountFactors(); var amount = solver.GetFactorsAmount(n); amount.Should().Be(1); }
public void GetFactorsAmount_BigInt_Many() { var bigNumber = 2_147_395_600; var solver = new CountFactors(); var amount = solver.GetFactorsAmount(bigNumber); _outputHelper.WriteLine($"{bigNumber} has {amount} divisors"); }