public void Test_IsPalindrome() { var exercise05 = new Exercise05(); Assert.AreEqual(exercise05.IsPalindrome("abcdcba"), true); Assert.AreEqual(exercise05.IsPalindrome("abcd"), false); }
public void ShouldReturnTrueForValuesNearMultiplesOfOneHundred() { Assert.That(!Exercise05.IsWithinFiveOfAHundred(-106)); Assert.That(!Exercise05.IsWithinFiveOfAHundred(37)); Assert.That(!Exercise05.IsWithinFiveOfAHundred(-94)); Assert.That(Exercise05.IsWithinFiveOfAHundred(-105)); Assert.That(Exercise05.IsWithinFiveOfAHundred(95)); }
public void TestIncorrectPowers() { for (int i = 1; i < 30; i++) { var actualResult = Exercise05.Run((int)Math.Pow(2, i) + 1); Assert.IsFalse(actualResult); } }
public void TestIncorrectPowers() { for (var i = 1; i < 30; i++) { var actualResult = Exercise05.Run((int)Math.Pow(2, i) + 1); actualResult.Should().BeFalse(); } }
public void Test_ArmstrongNumbers() { var exercise05 = new Exercise05(); Assert.AreEqual(exercise05.ArmstrongNumbers(3), "153 370 371 407"); Assert.AreEqual(exercise05.ArmstrongNumbers(4), "1634 8208 9474"); Assert.AreEqual(exercise05.ArmstrongNumbers(5), "54748 92727 93084"); }
public void Test_TimSo_Ok(string result) { Assert.AreEqual(Exercise05.FindNumber(), result); }
public void TestZeroNumber() { var actualResult = Exercise05.Run(0); actualResult.Should().BeFalse(); }
public void TestNegativeNumber() { var actualResult = Exercise05.Run(-2); actualResult.Should().BeFalse(); }
public void Exercise05_Test(int resultExpected, string text) { var result = Exercise05.DistinctCharacters(text); Assert.Equal(resultExpected, result); }
public void TestZeroNumber() { var actualResult = Exercise05.Run(0); Assert.IsFalse(actualResult); }
public void TestNegativeNumber() { var actualResult = Exercise05.Run(-2); Assert.IsFalse(actualResult); }
public void Test_LongestIncreasingSubArray() { var exercise05 = new Exercise05(); Assert.AreEqual(exercise05.LongestIncreasingSubArray(new int[] { 5, 6, 3, 5, 7, 8, 9, 1, 2 }), "3 5 7 8 9"); }