public void MoveToNextTest() { Size windowSize = new Size(10, 10); Size elementSize = new Size(2, 2); Panel3DPositioner target = new Panel3DPositioner(windowSize, elementSize, 0); Assert.AreEqual(target.Index, 0); target.MoveToNext(); Assert.AreEqual(target.Index, 1); target.MoveToNext(); Assert.AreEqual(target.Index, 2); target.MoveToNext(); Assert.AreEqual(target.Index, 3); }
private static void CalculateCurrentPositionTest(Size windowSize, Size elSize, IEnumerable <double[]> expectedPositionsArray, IPanel3DScaleFunction scaleFunction) { var positioner = new Panel3DPositioner(windowSize, elSize, 0, scaleFunction); foreach (var expectedPosition in expectedPositionsArray.Select(pos => new Position3D(pos[0], pos[1], 1, 1, HorizontalAlignment.Left, 0))) { var calculatedPosition = positioner.CalculateCurrentPosition(); Assert.AreEqual(expectedPosition.X, calculatedPosition.X, 0.25); Assert.AreEqual(expectedPosition.Y, calculatedPosition.Y, 0.25); positioner.MoveToNext(); } }
public void CurrentColTest2() { var target = new Panel3DPositioner(new Size(10, 100), new Size(1, 1), 0); Assert.AreEqual(0, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(1, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(2, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(3, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(4, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(5, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(6, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(7, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(8, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(9, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(0, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(1, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(2, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(3, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(4, target.CurrentCol); target.MoveToNext(); }
public void CurrentColTest() { var target = new Panel3DPositioner(new Size(6, 100), new Size(2, 2), 0); Assert.AreEqual(0, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(1, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(2, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(0, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(1, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(2, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(0, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(1, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(2, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(0, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(1, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(2, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(0, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(1, target.CurrentCol); target.MoveToNext(); Assert.AreEqual(2, target.CurrentCol); target.MoveToNext(); }