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)); }); }
public void SliceDelete_FromIndexedExtensions_GivenNullSource_ThrowsArgumentNullException() { Assert.Throws <ArgumentNullException>(() => IndexedExtensions.SliceDelete <int>(null)); }
public void SliceDelete_FromIndexedExtensions_GivenStepZero_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => IndexedExtensions.SliceDelete(Enumerable.Empty <int>().ToArray(), step: 0)); }