Beispiel #1
0
        public void BitManipulationNextNumber1BruteForceCompleteTestGetNext6NoSolution()
        {
            var original = Convert.ToInt32("01111111111111110000000000000000", 2);
            var actual   = BitManipulationNextNumber1BruteForceComplete.GetNext(original);

            Assert.AreEqual(-1, actual);
        }
Beispiel #2
0
        public void BitManipulationNextNumber1BruteForceCompleteTestGetNext2Simple2()
        {
            var original = Convert.ToInt32("101010011101100", 2);
            var expected = Convert.ToInt32("101010011110001", 2);
            var actual   = BitManipulationNextNumber1BruteForceComplete.GetNext(original);

            Assert.AreEqual(expected, actual);
        }
Beispiel #3
0
 public void BitManipulationNextNumber1BruteForceCompleteTestGetNext4NegativeNumber()
 {
     try
     {
         BitManipulationNextNumber1BruteForceComplete.GetNext(-1);
     }
     catch (ArgumentException)
     {
         Assert.IsTrue(true);
         return;
     }
     Assert.Fail();
 }
Beispiel #4
0
        public void BitManipulationNextNumber1BruteForceCompleteTestGetNext5AllClear()
        {
            var actual = BitManipulationNextNumber1BruteForceComplete.GetNext(0);

            Assert.AreEqual(-1, actual);
        }