public void IsNumberEven(int number, bool expected) { // Arrange ChallengeSet02 challenger = new ChallengeSet02(); // Act bool actual = challenger.IsNumberEven(number); // Assert Assert.Equal(expected, actual); }
public void CountOfPositiveOddsBelowNumber(int number, int expected) { // Arrange ChallengeSet02 challenger = new ChallengeSet02(); // Act double actual = challenger.CountOfPositiveOddsBelowNumber(number); // Assert Assert.Equal(expected, actual); }
// [InlineData(null, false)] // Assumption: array will not be null public void CountOfElementsIsEven(string[] strings, bool expected) { // Arrange ChallengeSet02 challenger = new ChallengeSet02(); // Act bool actual = challenger.CountOfElementsIsEven(strings); // Assert Assert.Equal(expected, actual); }
public void SumEvens(int[] numbers, int expected) { // Arrange ChallengeSet02 challenger = new ChallengeSet02(); // Act int actual = challenger.SumEvens(numbers); // Assert Assert.Equal(expected, actual); }
// [InlineData(null, "", 3)] // Assumption: string will not be null public void GetLengthOfShortestString(string str1, string str2, int expected) { // Arrange ChallengeSet02 challenger = new ChallengeSet02(); // Act int actual = challenger.GetLengthOfShortestString(str1, str2); // Assert Assert.Equal(expected, actual); }
public void SumOfMinAndMax(IEnumerable <double> numbers, double expected) { // Arrange ChallengeSet02 challenger = new ChallengeSet02(); // Act double actual = challenger.SumOfMinAndMax(numbers); // Assert Assert.Equal(expected, actual); }
public void IsSumOdd(int[] numbers, bool expected) { // Arrange ChallengeSet02 challenger = new ChallengeSet02(); List <int> numbersList = numbers == null ? null : new List <int>(numbers); // Act bool actual = challenger.IsSumOdd(numbersList); // Assert Assert.Equal(expected, actual); }
public void CharacterIsNotALetter() { // Arrange ChallengeSet02 challenger = new ChallengeSet02(); string nonLetters = "0123456789`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?\u2222"; // Check all letters foreach (char letter in nonLetters) { // Act bool actual = challenger.CharacterIsALetter(letter); // Assert Assert.False(actual); } }
public void CharacterIsALetter() { // Arrange ChallengeSet02 challenger = new ChallengeSet02(); string lowercaseAlphabet = "abcdefghijklmnopqrstuvwxyz"; // Check all letters foreach (char letter in lowercaseAlphabet) { // Act bool lowercaseActual = challenger.CharacterIsALetter(letter); bool uppercaseActual = challenger.CharacterIsALetter(char.ToUpper(letter)); // Assert Assert.True(lowercaseActual); Assert.True(uppercaseActual); } }