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

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

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

            Assert.AreEqual(-1, actual);
        }