public void OverLappingReturns1NewShape() { IEnumerable <IPath> shapes = this.Clip(this.bigSquare, this.topLeft); Assert.Single(shapes); Assert.DoesNotContain(shapes, x => RectangularPolygonValueComparer.Equals(this.bigSquare, x)); Assert.DoesNotContain(shapes, x => RectangularPolygonValueComparer.Equals(this.topLeft, x)); }
public void TouchingButNotOverlapping() { IEnumerable <IPath> shapes = this.Clip(this.topMiddle, this.topLeft); Assert.Single(shapes); Assert.DoesNotContain(shapes, x => RectangularPolygonValueComparer.Equals(this.topMiddle, x)); Assert.DoesNotContain(shapes, x => RectangularPolygonValueComparer.Equals(this.topLeft, x)); }
public void OverlappingButNotCrossingReturnsOrigionalShapes() { IEnumerable <RectangularPolygon> shapes = this.Clip(this.bigSquare, this.hole) .OfType <Polygon>().Select(x => (RectangularPolygon)x); Assert.Equal(2, shapes.Count()); Assert.Contains(shapes, x => RectangularPolygonValueComparer.Equals(this.bigSquare, x)); Assert.Contains(shapes, x => RectangularPolygonValueComparer.Equals(this.hole, x)); }
public void BrushDefaultOptions() { this.operations.Clear(this.brush, this.rectangle); FillPathProcessor processor = this.Verify <FillPathProcessor>(); Assert.Equal(this.shapeOptions, processor.Options.ShapeOptions); Assert.True(RectangularPolygonValueComparer.Equals(this.RectanglePolygon, processor.Region)); Assert.Equal(this.brush, processor.Brush); }
public void CorrectlySetsPenAndPathDefaultOptions() { this.operations.Draw(this.pen, this.rectangle); DrawPathProcessor processor = this.Verify <DrawPathProcessor>(); Assert.Equal(this.shapeOptions, processor.Options.ShapeOptions); Assert.True(RectangularPolygonValueComparer.Equals(this.RectanglePolygon, processor.Path)); Assert.Equal(this.pen, processor.Pen); }
public void NonOverlapping() { IEnumerable <RectangularPolygon> shapes = this.Clip(this.topLeft, this.topRight) .OfType <Polygon>().Select(x => (RectangularPolygon)x); Assert.Single(shapes); Assert.Contains( shapes, x => RectangularPolygonValueComparer.Equals(this.topLeft, x)); Assert.DoesNotContain(this.topRight, shapes); }
public void BrushAndThicknessDefaultOptions() { this.operations.Draw(this.pen.StrokeFill, 10, this.rectangle); DrawPathProcessor processor = this.Verify <DrawPathProcessor>(); Assert.Equal(this.shapeOptions, processor.Options.ShapeOptions); Assert.True(RectangularPolygonValueComparer.Equals(this.RectanglePolygon, processor.Path)); Assert.NotEqual(this.pen, processor.Pen); Assert.Equal(this.pen.StrokeFill, processor.Pen.StrokeFill); Assert.Equal(10, processor.Pen.StrokeWidth); }
public void JointAndEndCapStyle() { this.operations.Draw(new DrawingOptions(), this.pen.StrokeFill, 10, this.rectangle); DrawPathProcessor processor = this.Verify <DrawPathProcessor>(); Assert.NotEqual(this.shapeOptions, processor.Options.ShapeOptions); Assert.True(RectangularPolygonValueComparer.Equals(this.RectanglePolygon, processor.Path)); Assert.NotEqual(this.pen, processor.Pen); Assert.Equal(this.pen.JointStyle, processor.Pen.JointStyle); Assert.Equal(this.pen.EndCapStyle, processor.Pen.EndCapStyle); }
public void ColorAndThicknessDefaultOptions() { this.operations.Clear(Color.Red, this.rectangle); FillPathProcessor processor = this.Verify <FillPathProcessor>(); Assert.Equal(this.shapeOptions, processor.Options.ShapeOptions); Assert.True(RectangularPolygonValueComparer.Equals(this.RectanglePolygon, processor.Region)); Assert.NotEqual(this.brush, processor.Brush); SolidBrush brush = Assert.IsType <SolidBrush>(processor.Brush); Assert.Equal(Color.Red, brush.Color); }
public void ColorAndThickness() { this.operations.Draw(new DrawingOptions(), Color.Red, 10, this.rectangle); DrawPathProcessor processor = this.Verify <DrawPathProcessor>(); Assert.NotEqual(this.shapeOptions, processor.Options.ShapeOptions); Assert.True(RectangularPolygonValueComparer.Equals(this.RectanglePolygon, processor.Path)); Assert.NotEqual(this.pen, processor.Pen); SolidBrush brush = Assert.IsType <SolidBrush>(processor.Pen.StrokeFill); Assert.Equal(Color.Red, brush.Color); Assert.Equal(10, processor.Pen.StrokeWidth); }