public void IsPrime_GivenAPrime_ReturnsTrue(int aPrimeNumber) { var hp = new HappyPrimes(); var actualResult = hp.IsPrime(aPrimeNumber); var expectedResult = true; Assert.AreEqual(expectedResult, actualResult); }
public void IsPrime_GivenNonPrime_ReturnsFalse(int notAPrimeNumber) { var hp = new HappyPrimes(); var actualResult = hp.IsPrime(notAPrimeNumber); var expectedResult = false; Assert.AreEqual(expectedResult, actualResult); }
public void IsPrime_GivenInvalidNonComposite_ThrowsException(int invalidNonComposite) { var hp = new HappyPrimes(); Assert.Throws <ArithmeticException>(() => hp.IsPrime(invalidNonComposite)); }