public void Insert_ArgumentOutOfRangeException() { var destination = Convert.ToInt32(TestContext.DataRow["Destination"]); var source = Convert.ToInt32(TestContext.DataRow["Source"]); var startIndex = Convert.ToInt32(TestContext.DataRow["StartIndex"]); var endIndex = Convert.ToInt32(TestContext.DataRow["EndIndex"]); BinaryOperations.Insert(destination, source, startIndex, endIndex); }
public void Insert_Positive() { var destination = Convert.ToInt32(TestContext.DataRow["Destination"]); var source = Convert.ToInt32(TestContext.DataRow["Source"]); var startIndex = Convert.ToInt32(TestContext.DataRow["StartIndex"]); var endIndex = Convert.ToInt32(TestContext.DataRow["EndIndex"]); var expected = Convert.ToInt32(TestContext.DataRow["ExpectedResult"]); var actual = BinaryOperations.Insert(destination, source, startIndex, endIndex); Assert.AreEqual(expected, actual); }
public void Insert_ThrowsArgumentException(int first, int second, int startPosition, int finishPosition) { Assert.Throws <ArgumentException>(() => BinaryOperations.Insert(first, second, startPosition, finishPosition)); }
[TestCase(-8, -15, 1, 4, ExpectedResult = -30)] //-6 public int Insert_PositiveTest(int first, int second, int startPosition, int finishPosition) { return(BinaryOperations.Insert(first, second, startPosition, finishPosition)); }