示例#1
0
        public void BitManipulationNextNumber3ArithmeticCompleteTestGetNext6NoSolution()
        {
            var original = Convert.ToInt32("01111111111111110000000000000000", 2);
            var actual   = BitManipulationNextNumber3ArithmeticComplete.GetNext(original);

            Assert.AreEqual(-1, actual);
        }
示例#2
0
        public void BitManipulationNextNumber3ArithmeticCompleteTestGetPrev5AllClear()
        {
            var original = 0;
            var actual   = BitManipulationNextNumber3ArithmeticComplete.GetPrev(original);

            Assert.AreEqual(-1, actual);
        }
示例#3
0
        public void BitManipulationNextNumber3ArithmeticCompleteTestGetPrev3AllSet()
        {
            var original = Convert.ToInt32("01111111111111111111111111111111", 2);
            var actual   = BitManipulationNextNumber3ArithmeticComplete.GetPrev(original);

            Assert.AreEqual(-1, actual);
        }
示例#4
0
        public void BitManipulationNextNumber3ArithmeticCompleteTestGetPrev1Simple()
        {
            var original = Convert.ToInt32("10", 2);
            var expected = Convert.ToInt32("1", 2);
            var actual   = BitManipulationNextNumber3ArithmeticComplete.GetPrev(original);

            Assert.AreEqual(expected, actual);
        }
示例#5
0
 public void BitManipulationNextNumber3ArithmeticCompleteTestGetNext4NegativeNumber()
 {
     try
     {
         BitManipulationNextNumber3ArithmeticComplete.GetNext(-1);
     }
     catch (ArgumentException)
     {
         Assert.IsTrue(true);
         return;
     }
     Assert.Fail();
 }
示例#6
0
        public void BitManipulationNextNumber3ArithmeticCompleteTestGetNext5AllClear()
        {
            var actual = BitManipulationNextNumber3ArithmeticComplete.GetNext(0);

            Assert.AreEqual(-1, actual);
        }
示例#7
0
        public void BitManipulationNextNumber3ArithmeticCompleteTestGetPrev6NoSolution()
        {
            var actual = BitManipulationNextNumber3ArithmeticComplete.GetPrev(Convert.ToInt32("1111", 2));

            Assert.AreEqual(-1, actual);
        }