Esempio n. 1
0
        public void BitManipulationNextNumber2BitAdjustCompleteTestGetNext6NoSolution()
        {
            var original = Convert.ToInt32("01111111111111110000000000000000", 2);
            var actual   = BitManipulationNextNumber2BitAdjustComplete.GetNext(original);

            Assert.AreEqual(-1, actual);
        }
Esempio n. 2
0
        public void BitManipulationNextNumber2BitAdjustCompleteTestGetPrev5AllClear()
        {
            var original = 0;
            var actual   = BitManipulationNextNumber2BitAdjustComplete.GetPrev(original);

            Assert.AreEqual(-1, actual);
        }
Esempio n. 3
0
        public void BitManipulationNextNumber2BitAdjustCompleteTestGetPrev3AllSet()
        {
            var original = Convert.ToInt32("01111111111111111111111111111111", 2);
            var actual   = BitManipulationNextNumber2BitAdjustComplete.GetPrev(original);

            Assert.AreEqual(-1, actual);
        }
Esempio n. 4
0
        public void BitManipulationNextNumber2BitAdjustCompleteTestGetPrev1Simple()
        {
            var original = Convert.ToInt32("10", 2);
            var expected = Convert.ToInt32("1", 2);
            var actual   = BitManipulationNextNumber2BitAdjustComplete.GetPrev(original);

            Assert.AreEqual(expected, actual);
        }
Esempio n. 5
0
 public void BitManipulationNextNumber2BitAdjustCompleteTestGetNext4NegativeNumber()
 {
     try
     {
         BitManipulationNextNumber2BitAdjustComplete.GetNext(-1);
     }
     catch (ArgumentException)
     {
         Assert.IsTrue(true);
         return;
     }
     Assert.Fail();
 }
Esempio n. 6
0
        public void BitManipulationNextNumber2BitAdjustCompleteTestGetNext5AllClear()
        {
            var actual = BitManipulationNextNumber2BitAdjustComplete.GetNext(0);

            Assert.AreEqual(-1, actual);
        }
Esempio n. 7
0
        public void BitManipulationNextNumber2BitAdjustCompleteTestGetPrev6NoSolution()
        {
            var actual = BitManipulationNextNumber2BitAdjustComplete.GetPrev(Convert.ToInt32("1111", 2));

            Assert.AreEqual(-1, actual);
        }