Ejemplo n.º 1
0
        public void ParseNegativeStringToInt_Success()
        {
            var strNumber = "-1000";
            var result    = ParseNumber.Parse(strNumber);

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

            Assert.AreEqual(1234, result);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 4
0
 public void ThrowOverflowExceptionBound()
 {
     ParseNumber.Parse("2147483648");
 }
Ejemplo n.º 5
0
 public void ThrowFormatException()
 {
     ParseNumber.Parse("1b1");
 }
Ejemplo n.º 6
0
 public void ThrowOverflowException()
 {
     ParseNumber.Parse("111111111111111111111");
 }
Ejemplo n.º 7
0
 public void ThrowIfCannotParse()
 {
     ParseNumber.Parse(null);
 }