public void MakeSureInputIsALetterInTheAlphabet() { // setup, can be any letter in alphabet var input = char.ToUpper('d'); // Make sure method returns correct result var generated = CheckInput.CheckChar(input); Assert.AreEqual(input, generated); }
public void MakeSureInvalidInputGetsChanged() { //setup var input = '@'; // check for character validity if (input >= 'a' && input <= 'z' || input >= 'A' && input <= 'Z') { input = '@'; } else { // Any letter, just need to see the input changed from invalid character input = 'C'; } // generate an output for comparison var generated = CheckInput.CheckChar(input); Assert.AreEqual(input, generated); }