public void FindLargestPrimeLessThanInput_GivenThatInputIsNegative_ReturnsMinus1() { BigInteger input = -7; BigInteger expected = -1; var prime = DHLib.FindLargestPrimeLTEInput(input); Assert.IsFalse(DHLib.IsPrime(prime)); Assert.AreEqual(expected, prime); }
public void FindLargestPrimeLessThanInput_GivenThatInputIs10_Returns7() { BigInteger input = 10; BigInteger expected = 7; var prime = DHLib.FindLargestPrimeLTEInput(input); Assert.IsTrue(DHLib.IsPrime(prime)); Assert.AreEqual(expected, prime); }