コード例 #1
0
        public void BitManipulationNextNumber1BruteForceCompleteTestGetPrev5AllClear()
        {
            var original = 0;
            var actual   = BitManipulationNextNumber1BruteForceComplete.GetPrev(original);

            Assert.AreEqual(-1, actual);
        }
コード例 #2
0
        public void BitManipulationNextNumber1BruteForceCompleteTestGetPrev3AllSet()
        {
            var original = Convert.ToInt32("01111111111111111111111111111111", 2);
            var actual   = BitManipulationNextNumber1BruteForceComplete.GetPrev(original);

            Assert.AreEqual(-1, actual);
        }
コード例 #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);
        }
コード例 #4
0
 public void BitManipulationNextNumber1BruteForceCompleteTestGetPrev4NegativeNumber()
 {
     try
     {
         BitManipulationNextNumber1BruteForceComplete.GetPrev(-1);
     }
     catch (ArgumentException)
     {
         Assert.IsTrue(true);
         return;
     }
     Assert.Fail();
 }
コード例 #5
0
        public void BitManipulationNextNumber1BruteForceCompleteTestGetPrev6NoSolution()
        {
            var actual = BitManipulationNextNumber1BruteForceComplete.GetPrev(Convert.ToInt32("1111", 2));

            Assert.AreEqual(-1, actual);
        }