Пример #1
0
        public void BinaryInsertion_EightAndEightWithZeroAndZeroPositions_Eight()
        {
            const int expected = 8;
            var       actual   = BinaryInsertAlgorithm.BinaryInsert(8, 8, 0, 0);

            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void BinaryInsertion_EightAndFifteenWithThreeAndEightPositions_OneHundredTwenty()
        {
            const int expected = 120;
            var       actual   = BinaryInsertAlgorithm.BinaryInsert(8, 15, 3, 8);

            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public void BinaryInsertion_StaticDataInsertion_IntWWithInsertedBits()
        {
            var expected = StringBinaryInsertionCheck(15, 8, 3, 8);
            var actual   = BinaryInsertAlgorithm.BinaryInsert(15, 8, 3, 8);

            Assert.AreEqual(expected, actual);
        }
Пример #4
0
        public void BinaryInsertion_ValidInputs_ValidAnswer(int nIn, int nInsert, int start, int end)
        {
            var expected = StringBinaryInsertionCheck(nIn, nInsert, start, end);
            var actual   = BinaryInsertAlgorithm.BinaryInsert(nIn, nInsert, start, end);

            Assert.AreEqual(expected, actual);
        }
Пример #5
0
 public void BinaryInsertion_StartIsGraterThanEnd_ArgumentOutOfRangeException()
 {
     BinaryInsertAlgorithm.BinaryInsert(10, 10, 20, 10);
 }
Пример #6
0
 public void BinaryInsertion_EndIsGraterThanZero_ArgumentOutOfRangeException()
 {
     BinaryInsertAlgorithm.BinaryInsert(10, 10, 0, 32);
 }
Пример #7
0
 public void BinaryInsertion_StartIsLessThanZero_ArgumentOutOfRangeException()
 {
     BinaryInsertAlgorithm.BinaryInsert(10, 10, -1, 10);
 }
Пример #8
0
 public void BinaryInsertion_StartIsGraterThanEnd_ArgumentOutOfRangeException()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() =>
                                                 BinaryInsertAlgorithm.BinaryInsert(15, 8, 0, 32));
 }
Пример #9
0
 public void BinaryInsertion_StartIsLessThanZero_ArgumentOutOfRangeException()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() =>
                                                 BinaryInsertAlgorithm.BinaryInsert(15, 8, -1, 5));
 }