public void TestApplication_IfNumber99999_ReturnsTwoPrimeMultipliers() { // Arrange PrimeNumberAlgorithm primeNumberAlgorithm = new PrimeNumberAlgorithm(); // Act this._data = this._application.GetLargestPrimePalindrome(); IList <long> multipliersList = new List <long>() { this._data.FirstMultiplier, this._data.SecondMultiplier }; // Assert const bool expected = true; bool actual; int resultLength = multipliersList.Count - 1; for (int index = 1; index < resultLength; index++) { actual = primeNumberAlgorithm.IsPrimeNumber(multipliersList[index]); Assert.AreEqual(expected, actual); } }
public void TestPrimeNumbers_IfNumber0_ReturnsFalse() { // Act bool result = _primeNumberAlgorithm.IsPrimeNumber(0); // Assert this._expected = false; this._actual = result; Assert.AreEqual(this._expected, this._actual); }
private void GeneratePrimeNumbersList(long initNumber) { this._primeNumbersList = new LinkedList <long>(); long currentNumber; for (currentNumber = initNumber; currentNumber > this._digitMinimum; currentNumber -= 2) { this._primeNumber = _primeNumberAlgorithm.IsPrimeNumber(currentNumber); if (this._primeNumber) { this._primeNumbersList.AddLast(currentNumber); } } }