示例#1
0
        public void ConsecutiveOnesTest_BackLoad()
        {
            string binary = "001";
            int    result = BinaryCounter.ConsecutiveOnes(binary);

            Assert.AreEqual(1, result);
        }
示例#2
0
        public void ConsecutiveOnesTest_None()
        {
            string binary = "00";
            int    result = BinaryCounter.ConsecutiveOnes(binary);

            Assert.AreEqual(0, result);
        }
示例#3
0
        public void ConsecutiveOnesTest_FrontLoad()
        {
            string binary = "1100";
            int    result = BinaryCounter.ConsecutiveOnes(binary);

            Assert.AreEqual(2, result);
        }
示例#4
0
        public void ConsecutiveOnesTest_End()
        {
            string binary = "10111";
            int    result = BinaryCounter.ConsecutiveOnes(binary);

            Assert.AreEqual(3, result);
        }
示例#5
0
        public void ConsecutiveOnesTest_IntConversion10()
        {
            int result = BinaryCounter.ConsecutiveOnes(10);

            Assert.AreEqual(1, result);
        }