Пример #1
0
        public void SliceDelete_FromIndexedExtensions_ReturnsCorrectValues()
        {
            this.RunSliceTestCases((from, to, step, length) =>
            {
                var source   = Enumerable.Range(0, length).ToArray();
                var sut      = IndexedExtensions.SliceDelete(source, from, to, step).ToArray();
                var expected = SliceDeleteExpectedResultCalculator.Calculate(from, to, step, length);

                Assert.True(
                    expected.SequenceEqual(sut),
                    ErrorFormatter.Format(sliceDeleteResultErrorFormat, source, from, to, step, expected, sut));
            });
        }
Пример #2
0
 public void SliceDelete_FromIndexedExtensions_GivenNullSource_ThrowsArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() => IndexedExtensions.SliceDelete <int>(null));
 }
Пример #3
0
 public void SliceDelete_FromIndexedExtensions_GivenStepZero_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() => IndexedExtensions.SliceDelete(Enumerable.Empty <int>().ToArray(), step: 0));
 }