static void Main(string[] args) { long upperLimit = 2000000; PrimeFactorGenerator primeFactorGenerator = new PrimeFactorGenerator(); primeFactorGenerator.GetPrimesBelow(upperLimit); Console.WriteLine(primeFactorGenerator.PrimeFactors.Sum()); Console.ReadKey(); }
public void NoPrimeFactors() { int number = 1; List <int> expected = new List <int>(); List <int> actual = PrimeFactorGenerator.GetNumberOfPrimeFactors(number); CollectionAssert.AreEqual(expected, actual); }
public void Prime_Factors_of_twelve(int number) { var primeFactorGenerator = new PrimeFactorGenerator(); var expectedPrimeFactors = new List <int> { 2, 2, 3 }; Assert.Equal(expectedPrimeFactors, primeFactorGenerator.GetPrimeFactors(number)); }
public void OnePrimeFactorDouble() { int number = 4; List <int> expected = new List <int> { 2 }; List <int> actual = PrimeFactorGenerator.GetNumberOfPrimeFactors(number); CollectionAssert.AreEqual(expected, actual); }
public void PrimeNumTestOne() { //arrange int num = 7; string expected = "7"; //assign string actual = PrimeFactorGenerator.PrimeFactors(num); //assert Assert.Equal(expected, actual); }
public void Prime_Factors_of_One(int number) { var primeFactorGenerator = new PrimeFactorGenerator(); Assert.Empty(primeFactorGenerator.GetPrimeFactors(number)); }
static void Main(string[] args) { string test = PrimeFactorGenerator.PrimeFactors(7); WriteLine(test); }
public void Test1() { Assert.AreEqual("", string.Join(",", PrimeFactorGenerator.GenerateFactors(1))); }
public void Test100() { Assert.AreEqual("2,2,5,5", string.Join(",", PrimeFactorGenerator.GenerateFactors(100))); }
public void Test30() { Assert.AreEqual("2,3,5", string.Join(",", PrimeFactorGenerator.GenerateFactors(30))); }
public void Test4() { Assert.AreEqual("2,2", string.Join(",", PrimeFactorGenerator.GenerateFactors(4))); }