public void TestCircularShift() { var x = new[] { 1.0, 2, 3, 4, 5, 6, 7, 8 }; var output = Dsp.CircularShift(x, 0).ToReadOnlyList(); FilterAssert.ListsAreEqual(x, output); output = Dsp.CircularShift(x, -2).ToReadOnlyList(); FilterAssert.ListsAreEqual(new[] { 7, 8, 1.0, 2, 3, 4, 5, 6 }, output); output = Dsp.CircularShift(x, 2).ToReadOnlyList(); FilterAssert.ListsAreEqual(new[] { 3, 4, 5, 6, 7, 8, 1.0, 2 }, output); Assert.That(Dsp.CircularShift(new List <double>(), 2).ToReadOnlyList().Count == 0); Assert.Throws <ArgumentNullException>(() => Dsp.CircularShift <double>(null, 2).ToReadOnlyList()); }