public void ConvertNumericStringInvalid() { var result = SimpleStrToIntLogic.ConvertNumericOnly("SDLJ$9DSLKj"); Assert.IsFalse(result.HasValue); result = SimpleStrToIntLogic.ConvertNumericOnly(""); Assert.IsFalse(result.HasValue); }
public void ConvertNumericString() { var result = SimpleStrToIntLogic.ConvertNumericOnly("12345"); Assert.AreEqual(12345, result); result = SimpleStrToIntLogic.ConvertNumericOnly("-12345"); Assert.AreEqual(-12345, result); result = SimpleStrToIntLogic.ConvertNumericOnly("111111111111111111"); Assert.AreEqual(111111111111111111, result); }
public void ConvertNumericStringTooLong() { var result = SimpleStrToIntLogic.ConvertNumericOnly("1111111111111111111111"); Assert.IsFalse(result.HasValue); }