Exemplo n.º 1
0
        public void BitManipulationNextNumber1BruteForceCompleteTestGetPrev5AllClear()
        {
            var original = 0;
            var actual   = BitManipulationNextNumber1BruteForceComplete.GetPrev(original);

            Assert.AreEqual(-1, actual);
        }
Exemplo n.º 2
0
        public void BitManipulationNextNumber1BruteForceCompleteTestGetPrev3AllSet()
        {
            var original = Convert.ToInt32("01111111111111111111111111111111", 2);
            var actual   = BitManipulationNextNumber1BruteForceComplete.GetPrev(original);

            Assert.AreEqual(-1, actual);
        }
Exemplo n.º 3
0
        public void BitManipulationNextNumber1BruteForceCompleteTestGetPrev1Simple()
        {
            var original = Convert.ToInt32("10", 2);
            var expected = Convert.ToInt32("1", 2);
            var actual   = BitManipulationNextNumber1BruteForceComplete.GetPrev(original);

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 4
0
 public void BitManipulationNextNumber1BruteForceCompleteTestGetPrev4NegativeNumber()
 {
     try
     {
         BitManipulationNextNumber1BruteForceComplete.GetPrev(-1);
     }
     catch (ArgumentException)
     {
         Assert.IsTrue(true);
         return;
     }
     Assert.Fail();
 }
Exemplo n.º 5
0
        public void BitManipulationNextNumber1BruteForceCompleteTestGetPrev6NoSolution()
        {
            var actual = BitManipulationNextNumber1BruteForceComplete.GetPrev(Convert.ToInt32("1111", 2));

            Assert.AreEqual(-1, actual);
        }