예제 #1
0
        public void ByteVector_GreaterThan()
        {
            byte[] sample = Enumerable.Range(0, 250).Select((i) => (byte)i).ToArray();

            Assert.AreEqual(1, ByteVector.GreaterThan(0, sample, 0, sample.Length));            // First
            Assert.AreEqual(2, ByteVector.GreaterThan(1, sample, 0, sample.Length));            // Second
            Assert.AreEqual(201, ByteVector.GreaterThan(200, sample, 0, sample.Length));        // Middle
            Assert.AreEqual(249, ByteVector.GreaterThan(248, sample, 0, sample.Length));        // Last
            Assert.AreEqual(-1, ByteVector.GreaterThan(249, sample, 0, sample.Length));         // Last

            Assert.AreEqual(5, ByteVector.GreaterThan(0, sample, 5, sample.Length));            // Index respected
            Assert.AreEqual(6, ByteVector.GreaterThan(5, sample, 5, sample.Length));            // Index respected
            Assert.AreEqual(-1, ByteVector.GreaterThan(248, sample, 0, sample.Length - 5));     // Index respected
            Assert.AreEqual(244, ByteVector.GreaterThan(243, sample, 0, sample.Length - 5));    // Index respected
        }