public void TestCompareValues()
        {
            const int testSize = 100;
            var       array0   = GenerateValues(testSize);
            var       data0    = new DicomAttributeBinaryData <T>(array0, true);
            var       data1    = new DicomAttributeBinaryData <T>(array0, true);

            AssertCompareValues(true, data0, data1, "initial");

            data1.SetValue(0, default(T));
            AssertCompareValues(false, data0, data1, "after setting 0 on one");

            data0.SetValue(0, default(T));
            AssertCompareValues(true, data0, data1, "after setting 0 on both");

            data1.SetValue(testSize / 2, default(T));
            AssertCompareValues(false, data0, data1, "after setting {0} on one", testSize / 2);

            data0.SetValue(testSize / 2, default(T));
            AssertCompareValues(true, data0, data1, "after setting {0} on both", testSize / 2);

            data1.SetValue(testSize, default(T));
            AssertCompareValues(false, data0, data1, "after setting {0} on one", testSize);

            data0.SetValue(testSize, default(T));
            AssertCompareValues(true, data0, data1, "after setting {0} on both", testSize);

            data1.AppendValue(default(T));
            AssertCompareValues(false, data0, data1, "after appending on one");

            data0.AppendValue(default(T));
            AssertCompareValues(true, data0, data1, "after appending on both");
        }
        public void TestGetSetValue2()
        {
            const int testSize = 10000;
            var       array0   = GenerateValues(testSize);
            var       data0    = new DicomAttributeBinaryData <T>(array0, true);

            data0.TestUseStream();

            for (var n = 0; n < testSize; ++n)
            {
                Assert.AreEqual(array0[n], data0.GetValue(n), "get array[{0}]", n);
            }

            for (var n = 0; n < testSize; ++n)
            {
                data0.SetValue(n, array0[n] = array0[(n + 500) % testSize]);
            }

            for (var n = 0; n < testSize; ++n)
            {
                Assert.AreEqual(array0[n], data0.GetValue(n), "set array[{0}]", n);
            }

            Assert.Throws <IndexOutOfRangeException>(() => data0.GetValue(-1), "Getting a value @-1");
            Assert.Throws <IndexOutOfRangeException>(() => data0.GetValue(testSize), "Getting a value @10000");
            Assert.Throws <IndexOutOfRangeException>(() => data0.GetValue(testSize + 1), "Getting a value @10001");
            Assert.Throws <IndexOutOfRangeException>(() => data0.SetValue(-1, default(T)), "Setting a value @-1");
            Assert.Throws <IndexOutOfRangeException>(() => data0.SetValue(testSize + 1, default(T)), "Setting a value @10001");
            Assert.DoesNotThrow(() => data0.SetValue(testSize, default(T)), "Setting a value @10000");
        }