public void ConvertStringToInt(string enteredString, int number) { IProcessString processString = new ProcessString(); var resultNumber = processString.ConvertStringToInt(enteredString); Assert.AreEqual(number, resultNumber); }
public void ExceptionShouldArise() { try { string enteredString = "fdgdg"; IProcessString processString = new ProcessString(); var resultNumber = processString.ConvertStringToInt(enteredString); Assert.Fail("no exception thrown"); } catch (StringCanNotBeConvertedToInt ex) { Assert.IsTrue(ex is StringCanNotBeConvertedToInt); } }