Ejemplo n.º 1
0
        public void DecodeIntegerNegativeNumberValid()
        {
            int actual   = BCoder.DecodeInteger("i-9e");
            int expected = -9;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void DecodeIntegerZeroValid()
        {
            int actual   = BCoder.DecodeInteger("i0e");
            int expected = 0;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void DecodeIntegerValidNumber()
        {
            int actual   = BCoder.DecodeInteger("i95e");
            int expected = 95;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
 public void DecodeIntegerEmptyInputInvalid()
 {
     try
     {
         int actual = BCoder.DecodeInteger("");
         Assert.Fail();
     }
     catch (ArgumentException)
     {
     }
 }
Ejemplo n.º 5
0
 public void DecodeIntegerJustMinusInvalid()
 {
     try
     {
         int actual = BCoder.DecodeInteger("i-e");
         Assert.Fail();
     }
     catch (ArgumentException)
     {
     }
 }
Ejemplo n.º 6
0
 public void DecodeIntegerStartWithZeroInvalid()
 {
     try
     {
         int actual = BCoder.DecodeInteger("i09e");
         Assert.Fail();
     }
     catch (ArgumentException)
     {
     }
 }
Ejemplo n.º 7
0
 public void DecodeIntegerNegativeZeroInvalid()
 {
     try
     {
         int actual = BCoder.DecodeInteger("i-0e");
         Assert.Fail();
     }
     catch (ArgumentException)
     {
     }
 }
Ejemplo n.º 8
0
 public void DecodeIntegerFakeStringInvalid()
 {
     try
     {
         int actual = BCoder.DecodeInteger("i293920oejdjd203e");
         Assert.Fail();
     }
     catch (ArgumentException)
     {
     }
 }
Ejemplo n.º 9
0
 public void DecodeIntegerGarbageStringInvalid()
 {
     try
     {
         int actual = BCoder.DecodeInteger("sj1s910j9101uj3901");
         Assert.Fail();
     }
     catch (ArgumentException)
     {
     }
 }