public void MovingTest() { var cl = new CircleArray<int>(new int[] { 0, 1, 2, 3, 4, 5, 6 }); Assert.AreEqual(7, cl.Length); for (var i = 0; i <= 19; ++i) // here we has stopped on 19 in order to test reset { Assert.AreEqual(i % 7, cl.Current); cl.MoveForward(); } cl.Reset(); for (var i = 21; i >= 0; --i) { Assert.AreEqual(i % 7, cl.Current); cl.MoveBack(); } cl.Reset(); Assert.AreEqual(0, cl.Current); Assert.AreEqual(1, cl.Next); Assert.AreEqual(6, cl.Prev); Assert.AreEqual(3, cl[3]); }
private async void DCPButtonPrevSrc_Click(object sender, EventArgs e) { _dets.MoveBack(); await SourcesInitialize(); }