Example #1
0
        public void IncTest()
        {
            SpecialVariableBaseNumber num = new SpecialVariableBaseNumber();

            Assert.AreEqual("0", num.ToString());

            for (int i = 0; i < 12; ++i)
            {
                num.Inc();
            }
            Assert.AreEqual("2,0,0,0", num.ToString());
        }
Example #2
0
        public void SpecialVariableBaseNumberTest1()
        {
            List <int> numbers = new List <int>();

            for (int i = 0; i <= 10; ++i)
            {
                numbers.Add((int)i);
            }
            SpecialVariableBaseNumber num = new SpecialVariableBaseNumber(numbers);

            Assert.AreEqual("10,9,8,7,6,5,4,3,2,1,0", num.ToString());
        }
Example #3
0
        public void IncByTest()
        {
            List <int> numbers = new List <int>();

            for (int i = 0; i <= 2; ++i)
            {
                numbers.Add(i);
            }
            SpecialVariableBaseNumber num = new SpecialVariableBaseNumber(numbers);

            Assert.AreEqual("2,1,0", num.ToString());

            num.IncBy(2);
            Assert.AreEqual("1,0,1,0", num.ToString());

            num.IncBy(1);
            Assert.AreEqual("1,1,0,0", num.ToString());

            num.IncBy(1);
            Assert.AreEqual("1,1,1,0", num.ToString());

            num.IncBy(1);
            Assert.AreEqual("1,2,0,0", num.ToString());

            num.IncBy(1);
            Assert.AreEqual("1,2,1,0", num.ToString());

            num.IncBy(1);
            Assert.AreEqual("2,0,0,0", num.ToString());

            num.IncBy(6);
            Assert.AreEqual("3,0,0,0", num.ToString());

            num.IncBy(6);
            Assert.AreEqual("1,0,0,0,0", num.ToString());
        }
Example #4
0
        public void SpecialVariableBaseNumberTest2()
        {
            SpecialVariableBaseNumber num = new SpecialVariableBaseNumber(3);

            Assert.AreEqual("0,0,0", num.ToString());
        }