Exemplo n.º 1
0
        public void AtoiV3_NegativeNumber()
        {
            string str = "   -45";

            var atoi   = new Atoi();
            int result = atoi.MyAtoiV3(str);

            Assert.AreEqual(-45, result);
        }
Exemplo n.º 2
0
        public void AtoiV3_ZerosFirst()
        {
            string str = "     000002147483645";

            var atoi   = new Atoi();
            int result = atoi.MyAtoiV3(str);

            Assert.AreEqual(2147483645, result);
        }
Exemplo n.º 3
0
        public void AtoiV3_SignAfterDigit()
        {
            string str = "1-5";

            var atoi   = new Atoi();
            int result = atoi.MyAtoiV3(str);

            Assert.AreEqual(1, result);
        }
Exemplo n.º 4
0
        public void AtoiV3_MoreThanMax()
        {
            string str = "2147483648";

            var atoi   = new Atoi();
            int result = atoi.MyAtoiV3(str);

            Assert.AreEqual(2147483647, result);
        }
Exemplo n.º 5
0
        public void AtoiV3_LetterFirst()
        {
            string str = "   a 45";

            var atoi   = new Atoi();
            int result = atoi.MyAtoiV3(str);

            Assert.AreEqual(0, result);
        }