public void FirstPointIsIdenticalWithUpperLeftCorner() { HorizontalStepper hs = new HorizontalStepper(this.polygon, this.colorTranslation); List <Step> steps = hs.CalculateFillSteps(); Assert.AreEqual(this.polygon.Vertices[0], steps[0].Point); }
public void FillStartsWithOutline() { HorizontalStepper h = new HorizontalStepper(this.polygon, this.colorTranslation); var fillSteps = h.CalculateFillSteps(); var outlineSteps = h.CalculateOutlineSteps(); Assert.AreEqual(fillSteps.First().Point, outlineSteps.Last().Point); }
public void FindsFiveIntersectionsForMediumHeightInverse() { this.colorTranslation.LineHeight = 0.45; HorizontalStepper hs = new HorizontalStepper(this.inverseTriangle, this.colorTranslation); List <Step> steps = hs.CalculateFillSteps(); Assert.AreEqual(5, steps.Count); }
public void FindsThreeIntersectionsForLargeHeight() { this.colorTranslation.LineHeight = 0.9; HorizontalStepper hs = new HorizontalStepper(this.triangle, this.colorTranslation); List <Step> steps = hs.CalculateFillSteps(); Assert.AreEqual(3, steps.Count); }
public void Angle0IsIdenticalWithHorizontal() { var ct = new ColorTranslation(); ct.LineHeight = 0.234; Polygon p = this.createDefaultPolygon(); HorizontalStepper hs = new HorizontalStepper(p, ct); AngleStepper a = new AngleStepper(p, ct); List <Step> stepsHorizontal = hs.CalculateFillSteps(); List <Step> stepsAngle = a.CalculateFillSteps(); CollectionAssert.AreEqual(stepsHorizontal, stepsAngle); }
public void StepsCountainNoDoubles() { HorizontalStepper hs = new HorizontalStepper(this.polygon, this.colorTranslation); List <Step> steps = hs.CalculateFillSteps(); bool isRepeated = false; var set = new HashSet <Tuple <double, double> >(); foreach (var x in steps) { if (!set.Add(new Tuple <double, double>(x.Point.X, x.Point.Y))) { isRepeated = true; break; } } Assert.IsFalse(isRepeated); }