public void ToDigitArray_WhenPassedANegative_ThrowsAnException() { var hp = new HappyPrimes(); var aNegativeInteger = -1234; Assert.Throws <NotImplementedException>(() => hp.ToDigitArray(aNegativeInteger)); }
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_GivenAPrime_ReturnsTrue(int aPrimeNumber) { var hp = new HappyPrimes(); var actualResult = hp.IsPrime(aPrimeNumber); var expectedResult = true; Assert.AreEqual(expectedResult, actualResult); }
public void ToDigitArray_Normally_ReturnsCorrectArray() { var hp = new HappyPrimes(); var actualResult = hp.ToDigitArray(234); var expectedResult = new int[] { 2, 3, 4 }; Assert.AreEqual(expectedResult, actualResult); }
public void IsHappyPrime_GivenNonHappyPrimes_ReturnsFalse(int unhappyPrime) { var hp = new HappyPrimes(); var actualResult = hp.IsHappyPrime(unhappyPrime); var expectedResult = false; Assert.AreEqual(expectedResult, actualResult); }
public void IsHappyPrime_GivenHappyPrimes_ReturnsTrue(int happyPrime) { var hp = new HappyPrimes(); var actualResult = hp.IsHappyPrime(happyPrime); var expectedResult = true; Assert.AreEqual(expectedResult, actualResult); }
public void IsPrime_GivenInvalidNonComposite_ThrowsException(int invalidNonComposite) { var hp = new HappyPrimes(); Assert.Throws <ArithmeticException>(() => hp.IsPrime(invalidNonComposite)); }