public void CreateList_CreatesListOfNums_List() { Primes testPrimes = new Primes(); List <int> newList = new List <int> { 2, 3, 4 }; List <int> result = testPrimes.CreateList(5); CollectionAssert.AreEqual(newList, result); }
public void ReturnPrimes_ReturnsPrimeList_List() { Primes testPrimes = new Primes(); List <int> newList = new List <int> { 2, 3 }; List <int> result = testPrimes.CreateList(5); CollectionAssert.AreEqual(newList, testPrimes.ReturnPrimes(result)); }
public static void Main() { Console.WriteLine("Enter a number to get all primes below that number: "); int number = int.Parse(Console.ReadLine()); Primes primeList = new Primes(); List <int> numList = primeList.CreateList(number); numList = primeList.ReturnPrimes(numList); foreach (int num in numList) { Console.WriteLine(num); } }