예제 #1
0
        public void BinaryNumbersOperations_LeftMoreRight_Exception()
        {
            int first, second, leftPosition, rightPosition;

            first         = 8;
            second        = 15;
            leftPosition  = 7;
            rightPosition = 6;

            int actual = BinaryOperations.BinaryNumbersOperation(first, second, leftPosition, rightPosition);
        }
예제 #2
0
        public void BinaryNumbersOperations_PositiveTest()
        {
            int first, second, leftPosition, rightPosition;

            first         = 15;
            second        = int.MaxValue;
            leftPosition  = 3;
            rightPosition = 5;

            int expected = 63;
            int actual   = BinaryOperations.BinaryNumbersOperation(first, second, leftPosition, rightPosition);

            Assert.AreEqual(expected, actual);
        }
예제 #3
0
 public void BinaryNumbersOperation_TrowsArgumentException(int first, int second, int leftPosition, int rightPosition)
 {
     Assert.Throws <ArgumentException>(
         () => BinaryOperations.BinaryNumbersOperation(first, second, leftPosition, rightPosition));
 }
예제 #4
0
 public int BinaryNumbersOperation_PositiveTest(int first, int second, int leftPosition, int rightPosition)
 {
     return(BinaryOperations.BinaryNumbersOperation(first, second, leftPosition, rightPosition));
 }