Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public void Insert_ThrowsArgumentException(int first, int second, int startPosition, int finishPosition)
 {
     Assert.Throws <ArgumentException>(() => BinaryOperations.Insert(first, second, startPosition, finishPosition));
 }
Exemplo n.º 4
0
 [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));
 }