Exemple #1
0
        public void CopyWithNegativeOffsetThrowsException()
        {
            var buffer = new SingleStatisticsCollection(4)
            {
                5,
                7,
                3
            };
            var arr = new float[3];

            Assert.Throws <ArgumentOutOfRangeException>(() =>
                                                        buffer.CopyTo(arr, -1));
        }
Exemple #2
0
        public void CopyWithTooLargeOffsetThrowsException()
        {
            var buffer = new SingleStatisticsCollection(4)
            {
                5,
                7,
                3
            };
            var arr = new float[3];

            Assert.Throws <ArgumentException>(() =>
                                              buffer.CopyTo(arr, 3));
        }
Exemple #3
0
        public void CopyUnfullWithOffsetThrowsExceptionWithTooSmallDestination()
        {
            var buffer = new SingleStatisticsCollection(4)
            {
                5,
                7,
                3
            };
            var arr = new float[3];

            Assert.Throws <ArgumentException>(() =>
                                              buffer.CopyTo(arr, 1));
        }
Exemple #4
0
        public void CopyUnfullUnwrappedBufferWithoutOffsetMaintainsOrder()
        {
            var buffer = new SingleStatisticsCollection(4)
            {
                5,
                7,
                3
            };
            var arr = new float[3];

            buffer.CopyTo(arr, 0);
            Assert.AreEqual(5, arr[0]);
            Assert.AreEqual(7, arr[1]);
            Assert.AreEqual(3, arr[2]);
        }
Exemple #5
0
        public void CopyFullUnwrappedBufferWithOffsetMaintainsOrder()
        {
            var buffer = new SingleStatisticsCollection(4)
            {
                5,
                7,
                3,
                13
            };
            var arr = new float[5];

            buffer.CopyTo(arr, 1);
            Assert.AreEqual(0, arr[0]);
            Assert.AreEqual(5, arr[1]);
            Assert.AreEqual(7, arr[2]);
            Assert.AreEqual(3, arr[3]);
            Assert.AreEqual(13, arr[4]);
        }