public void BinaryInsertion_EightAndEightWithZeroAndZeroPositions_Eight() { const int expected = 8; var actual = BinaryInsertAlgorithm.BinaryInsert(8, 8, 0, 0); Assert.AreEqual(expected, actual); }
public void BinaryInsertion_EightAndFifteenWithThreeAndEightPositions_OneHundredTwenty() { const int expected = 120; var actual = BinaryInsertAlgorithm.BinaryInsert(8, 15, 3, 8); Assert.AreEqual(expected, actual); }
public void BinaryInsertion_StaticDataInsertion_IntWWithInsertedBits() { var expected = StringBinaryInsertionCheck(15, 8, 3, 8); var actual = BinaryInsertAlgorithm.BinaryInsert(15, 8, 3, 8); Assert.AreEqual(expected, actual); }
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); }
public void BinaryInsertion_StartIsGraterThanEnd_ArgumentOutOfRangeException() { BinaryInsertAlgorithm.BinaryInsert(10, 10, 20, 10); }
public void BinaryInsertion_EndIsGraterThanZero_ArgumentOutOfRangeException() { BinaryInsertAlgorithm.BinaryInsert(10, 10, 0, 32); }
public void BinaryInsertion_StartIsLessThanZero_ArgumentOutOfRangeException() { BinaryInsertAlgorithm.BinaryInsert(10, 10, -1, 10); }
public void BinaryInsertion_StartIsGraterThanEnd_ArgumentOutOfRangeException() { Assert.Throws <ArgumentOutOfRangeException>(() => BinaryInsertAlgorithm.BinaryInsert(15, 8, 0, 32)); }
public void BinaryInsertion_StartIsLessThanZero_ArgumentOutOfRangeException() { Assert.Throws <ArgumentOutOfRangeException>(() => BinaryInsertAlgorithm.BinaryInsert(15, 8, -1, 5)); }