Example #1
0
        public void ParseNegativeStringToInt_Success()
        {
            var strNumber = "-1000";
            var result    = ParseNumber.Parse(strNumber);

            Assert.AreEqual(-1000, result);
        }
Example #2
0
        public void ParseStringToInt_Success()
        {
            var strNumber = "1234";
            var result    = ParseNumber.Parse(strNumber);

            Assert.AreEqual(1234, result);
        }
Example #3
0
 static void Main(string[] args)
 {
     while (true)
     {
         string a = Console.ReadLine();
         Console.WriteLine(ParseNumber.Parse(a));
     }
     //string a = "(54)";
     //out int b = 0;
     //Int32.TryParse(a,b);
 }
Example #4
0
 public void ThrowOverflowExceptionBound()
 {
     ParseNumber.Parse("2147483648");
 }
Example #5
0
 public void ThrowFormatException()
 {
     ParseNumber.Parse("1b1");
 }
Example #6
0
 public void ThrowOverflowException()
 {
     ParseNumber.Parse("111111111111111111111");
 }
Example #7
0
 public void ThrowIfCannotParse()
 {
     ParseNumber.Parse(null);
 }