Test for path type transfer

This commit is contained in:
Naxess 2021-04-09 11:03:38 +02:00
parent 2d94484566
commit 0af6d77192
1 changed files with 22 additions and 1 deletions

View File

@ -63,7 +63,7 @@ public void TestPerfectCurveTooManyPoints()
assertControlPointPathType(0, PathType.Bezier);
assertControlPointPathType(1, PathType.PerfectCurve);
AddAssert("point 3 is not inherited", () => slider.Path.ControlPoints[3].Type != null);
assertControlPointPathType(3, PathType.Bezier);
}
[Test]
@ -105,6 +105,27 @@ public void TestPerfectCurveLastTwoPoints()
AddAssert("point 3 is not inherited", () => slider.Path.ControlPoints[3].Type != null);
}
[Test]
public void TestPerfectCurveTooManyPointsLinear()
{
createVisualiser(true);
addControlPointStep(new Vector2(200), PathType.Linear);
addControlPointStep(new Vector2(300));
addControlPointStep(new Vector2(500, 300));
addControlPointStep(new Vector2(700, 200));
addControlPointStep(new Vector2(500, 100));
// Must be both hovering and selecting the control point for the context menu to work.
moveMouseToControlPoint(1);
AddStep("select control point", () => visualiser.Pieces[1].IsSelected.Value = true);
addContextMenuItemStep("Perfect curve");
assertControlPointPathType(0, PathType.Linear);
assertControlPointPathType(1, PathType.PerfectCurve);
assertControlPointPathType(3, PathType.Linear);
}
[Test]
public void TestPerfectCurveChangeToBezier()
{