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