Exemple #1
0
 public void InsertBits_InvalidIndexes_ArgumentOutOfRangeException(int firstNumber, int secondNumber, int i, int j)
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => BitsReplacement.InsertBits(firstNumber, secondNumber, i, j));
 }
Exemple #2
0
 public void InsertBits_EndingIndexIsGreaterThanStartingIndex_ArgumentException()
 {
     Assert.Throws <ArgumentException>(() => BitsReplacement.InsertBits(1, 1, 2, 1));
 }
Exemple #3
0
        public void InsertBits_ValidCases_NumberWithReplacedBits(int firstNumber, int secondNumber, int i, int j, int expectedResult)
        {
            int result = BitsReplacement.InsertBits(firstNumber, secondNumber, i, j);

            Assert.AreEqual(result, expectedResult);
        }