Beispiel #1
0
        public void TestTwoBucketCountOverflow()
        {
            ushort[] addresses     = { 0, 1, 2, 3, 4, 5, 6, 7 };
            ushort   maxContiguous = (ushort)(addresses.Length - 1);

            var buckets = ReadExtensions.FormBuckets(addresses, maxContiguous);

            Assert.AreEqual(2, buckets.Count());
        }
Beispiel #2
0
        public void TestFourBucketCountMultipleOverflow()
        {
            ushort[] addresses     = { 0, 1, 2, 3, 4, 5, 6, 7 };
            ushort   maxContiguous = 2;

            var buckets = ReadExtensions.FormBuckets(addresses, maxContiguous);

            Assert.AreEqual(4, buckets.Count());
        }
Beispiel #3
0
        public void TestOneBucketLengthNoOverflow()
        {
            ushort[] addresses     = { 0, 1, 2, 3, 4, 5, 6, 7 };
            ushort   maxContiguous = (ushort)addresses.Length;

            var    buckets = ReadExtensions.FormBuckets(addresses, maxContiguous);
            ushort length  = buckets.ElementAt(0).Item2;

            Assert.AreEqual(addresses.Length, length);
        }
Beispiel #4
0
        public void TestTwoBucketsLengthsNoOverflow()
        {
            ushort[] addresses     = { 0, 1, 2, 4, 5, 6, 7 };
            ushort   maxContiguous = (ushort)addresses.Length;

            var    buckets = ReadExtensions.FormBuckets(addresses, maxContiguous);
            ushort length1 = buckets.ElementAt(0).Item2;
            ushort length2 = buckets.ElementAt(1).Item2;

            Assert.AreEqual(3, length1);
            Assert.AreEqual(4, length2);
        }