コード例 #1
0
        public void CorrectlySetsBrushThicknessRectangleAndOptions()
        {
            img.Draw(brush, thickness, rectangle, noneDefault);

            Assert.NotEmpty(img.ProcessorApplications);
            DrawPathProcessor <Color> processor = Assert.IsType <DrawPathProcessor <Color> >(img.ProcessorApplications[0].processor);

            Assert.Equal(noneDefault, processor.Options);

            ShapePath shapepath = Assert.IsType <ShapePath>(processor.Path);

            Assert.NotEmpty(shapepath.Paths);

            SixLabors.Shapes.Rectangle rect = Assert.IsType <SixLabors.Shapes.Rectangle>(shapepath.Paths[0].AsShape());

            Assert.Equal(rect.Location.X, rectangle.X);
            Assert.Equal(rect.Location.Y, rectangle.Y);
            Assert.Equal(rect.Size.Width, rectangle.Width);
            Assert.Equal(rect.Size.Height, rectangle.Height);

            Pen <Color> pen = Assert.IsType <Pen <Color> >(processor.Pen);

            Assert.Equal(brush, pen.Brush);
            Assert.Equal(thickness, pen.Width);
        }
コード例 #2
0
        public void CorrectlySetsColorThicknessAndRectangle()
        {
            img.Draw(color, thickness, rectangle);

            Assert.NotEmpty(img.ProcessorApplications);
            DrawPathProcessor <Rgba32> processor = Assert.IsType <DrawPathProcessor <Rgba32> >(img.ProcessorApplications[0].processor);

            Assert.Equal(GraphicsOptions.Default, processor.Options);

            ShapePath shapepath = Assert.IsType <ShapePath>(processor.Path);

            SixLabors.Shapes.Rectangle rect = Assert.IsType <SixLabors.Shapes.Rectangle>(shapepath.Path);

            Assert.Equal(rect.Location.X, rectangle.X);
            Assert.Equal(rect.Location.Y, rectangle.Y);
            Assert.Equal(rect.Size.Width, rectangle.Width);
            Assert.Equal(rect.Size.Height, rectangle.Height);

            Pen <Rgba32> pen = Assert.IsType <Pen <Rgba32> >(processor.Pen);

            Assert.Equal(thickness, pen.Width);

            SolidBrush <Rgba32> brush = Assert.IsType <SolidBrush <Rgba32> >(pen.Brush);

            Assert.Equal(color, brush.Color);
        }
コード例 #3
0
        public void Pen()
        {
            this.operations.DrawPolygon(new ShapeGraphicsOptions(), this.pen, this.points);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.NotEqual(this.shapeOptions, processor.Options.ShapeOptions);
            this.VerifyPoints(this.points, processor.Shape);
            Assert.Equal(this.pen, processor.Pen);
        }
コード例 #4
0
        public void Pen()
        {
            this.operations.DrawLines(new DrawingOptions(), this.pen, this.points);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.NotEqual(this.shapeOptions, processor.Options.ShapeOptions);
            this.VerifyPoints(this.points, processor.Path);
            Assert.Equal(this.pen, processor.Pen);
        }
コード例 #5
0
        public void CorrectlySetsPenAndPathDefaultOptions()
        {
            this.operations.Draw(this.pen, this.rectangle);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.Equal(this.shapeOptions, processor.Options.ShapeOptions);
            Assert.Equal(this.rectanglePolygon, processor.Shape);
            Assert.Equal(this.pen, processor.Pen);
        }
コード例 #6
0
        public void CorrectlySetsPenAndPath()
        {
            this.operations.Draw(new DrawingOptions(), this.pen, this.rectangle);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.NotEqual(this.shapeOptions, processor.Options.ShapeOptions);
            Assert.True(RectangularPolygonValueComparer.Equals(this.RectanglePolygon, processor.Path));
            Assert.Equal(this.pen, processor.Pen);
        }
コード例 #7
0
        public void PenDefaultOptions()
        {
            this.operations.Draw(this.pen, this.path);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.Equal(this.shapeOptions, processor.Options.ShapeOptions);
            Assert.Equal(this.path, processor.Path);
            Assert.Equal(this.pen, processor.Pen);
        }
コード例 #8
0
        public void PenDefaultOptions()
        {
            this.operations.DrawBeziers(this.pen, this.points);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.Equal(this.shapeOptions, processor.Options.ShapeOptions);
            this.VerifyPoints(this.points, processor.Shape);
            Assert.Equal(this.pen, processor.Pen);
        }
コード例 #9
0
        public void JointAndEndCapStyleDefaultOptions()
        {
            this.operations.DrawBeziers(this.pen.StrokeFill, 10, this.points);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.Equal(this.shapeOptions, processor.Options.ShapeOptions);
            this.VerifyPoints(this.points, processor.Path);
            Assert.Equal(this.pen.JointStyle, processor.Pen.JointStyle);
            Assert.Equal(this.pen.EndCapStyle, processor.Pen.EndCapStyle);
        }
コード例 #10
0
        public void JointAndEndCapStyle()
        {
            this.operations.Draw(new DrawingOptions(), this.pen.StrokeFill, 10, this.path);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.NotEqual(this.shapeOptions, processor.Options.ShapeOptions);
            Assert.Equal(this.path, processor.Path);
            Assert.Equal(this.pen.JointStyle, processor.Pen.JointStyle);
            Assert.Equal(this.pen.EndCapStyle, processor.Pen.EndCapStyle);
        }
コード例 #11
0
        public void BrushAndThickness()
        {
            this.operations.DrawPolygon(new ShapeGraphicsOptions(), this.pen.StrokeFill, 10, this.points);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.NotEqual(this.shapeOptions, processor.Options.ShapeOptions);
            this.VerifyPoints(this.points, processor.Shape);
            Assert.Equal(this.pen.StrokeFill, processor.Pen.StrokeFill);
            Assert.Equal(10, processor.Pen.StrokeWidth);
        }
コード例 #12
0
        public void BrushAndThicknessDefaultOptions()
        {
            this.operations.DrawBeziers(this.pen.StrokeFill, 10, this.points);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.Equal(this.shapeOptions, processor.Options.ShapeOptions);
            this.VerifyPoints(this.points, processor.Shape);
            Assert.Equal(this.pen.StrokeFill, processor.Pen.StrokeFill);
            Assert.Equal(10, processor.Pen.StrokeWidth);
        }
コード例 #13
0
        public void BrushAndThickness()
        {
            this.operations.Draw(new DrawingOptions(), this.pen.StrokeFill, 10, this.path);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.NotEqual(this.shapeOptions, processor.Options.ShapeOptions);
            Assert.Equal(this.path, processor.Path);
            Assert.Equal(this.pen.StrokeFill, processor.Pen.StrokeFill);
            Assert.Equal(10, processor.Pen.StrokeWidth);
        }
コード例 #14
0
        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.Equal(this.rectanglePolygon, processor.Shape);
            Assert.NotEqual(this.pen, processor.Pen);
            Assert.Equal(this.pen.StrokeFill, processor.Pen.StrokeFill);
            Assert.Equal(10, processor.Pen.StrokeWidth);
        }
コード例 #15
0
        public void BrushAndThickness()
        {
            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.StrokeFill, processor.Pen.StrokeFill);
            Assert.Equal(10, processor.Pen.StrokeWidth);
        }
コード例 #16
0
        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);
        }
コード例 #17
0
        public void ColorAndThickness()
        {
            this.operations.DrawBeziers(new ShapeGraphicsOptions(), Color.Red, 10, this.points);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.NotEqual(this.shapeOptions, processor.Options.ShapeOptions);
            this.VerifyPoints(this.points, processor.Shape);
            SolidBrush brush = Assert.IsType <SolidBrush>(processor.Pen.StrokeFill);

            Assert.Equal(Color.Red, brush.Color);
            Assert.Equal(10, processor.Pen.StrokeWidth);
        }
コード例 #18
0
        public void ColorAndThicknessDefaultOptions()
        {
            this.operations.DrawPolygon(Color.Red, 10, this.points);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.Equal(this.shapeOptions, processor.Options.ShapeOptions);
            this.VerifyPoints(this.points, processor.Shape);
            var brush = Assert.IsType <SolidBrush>(processor.Pen.StrokeFill);

            Assert.Equal(Color.Red, brush.Color);
            Assert.Equal(10, processor.Pen.StrokeWidth);
        }
コード例 #19
0
        public void ColorAndThickness()
        {
            this.operations.Draw(new DrawingOptions(), Color.Red, 10, this.path);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.NotEqual(this.shapeOptions, processor.Options.ShapeOptions);
            Assert.Equal(this.path, processor.Path);
            SolidBrush brush = Assert.IsType <SolidBrush>(processor.Pen.StrokeFill);

            Assert.Equal(Color.Red, brush.Color);
            Assert.Equal(10, processor.Pen.StrokeWidth);
        }
コード例 #20
0
        public void ColorAndThickness()
        {
            this.operations.Draw(new ShapeGraphicsOptions(), Color.Red, 10, this.rectangle);

            DrawPathProcessor processor = this.Verify <DrawPathProcessor>();

            Assert.NotEqual(this.shapeOptions, processor.Options.ShapeOptions);
            Assert.Equal(this.rectanglePolygon, processor.Shape);
            Assert.NotEqual(this.pen, processor.Pen);
            var brush = Assert.IsType <SolidBrush>(processor.Pen.StrokeFill);

            Assert.Equal(Color.Red, brush.Color);
            Assert.Equal(10, processor.Pen.StrokeWidth);
        }
コード例 #21
0
        public void ColorAndThicknessDefaultOptions()
        {
            this.operations.Draw(Color.Red, 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);
            SolidBrush brush = Assert.IsType <SolidBrush>(processor.Pen.StrokeFill);

            Assert.Equal(Color.Red, brush.Color);
            Assert.Equal(10, processor.Pen.StrokeWidth);
        }
コード例 #22
0
        public void CorrectlySetsPenPathAndOptions()
        {
            img.Draw(pen, path, noneDefault);

            Assert.NotEmpty(img.ProcessorApplications);
            DrawPathProcessor <Color> processor = Assert.IsType <DrawPathProcessor <Color> >(img.ProcessorApplications[0].processor);

            Assert.Equal(noneDefault, processor.Options);

            ShapePath shapepath = Assert.IsType <ShapePath>(processor.Path);

            Assert.Equal(path, shapepath.Path);

            Assert.Equal(pen, processor.Pen);
        }
コード例 #23
0
        public void CorrectlySetsPenAndPath()
        {
            img.Draw(pen, path);

            Assert.NotEmpty(img.ProcessorApplications);
            DrawPathProcessor <Rgba32> processor = Assert.IsType <DrawPathProcessor <Rgba32> >(img.ProcessorApplications[0].processor);

            Assert.Equal(GraphicsOptions.Default, processor.Options);

            ShapePath shapepath = Assert.IsType <ShapePath>(processor.Path);

            Assert.Equal(path, shapepath.Path);

            Assert.Equal(pen, processor.Pen);
        }
コード例 #24
0
        public void CorrectlySetsPenPointsAndOptions()
        {
            img.DrawBeziers(pen, points, noneDefault);

            Assert.NotEmpty(img.ProcessorApplications);
            DrawPathProcessor <Color> processor = Assert.IsType <DrawPathProcessor <Color> >(img.ProcessorApplications[0].processor);

            Assert.Equal(noneDefault, processor.Options);

            ShapePath path = Assert.IsType <ShapePath>(processor.Path);

            SixLabors.Shapes.Path vector  = Assert.IsType <SixLabors.Shapes.Path>(path.Path);
            BezierLineSegment     segment = Assert.IsType <BezierLineSegment>(vector.LineSegments[0]);

            Assert.Equal(pen, processor.Pen);
        }
コード例 #25
0
        public void CorrectlySetsPenAndPoints()
        {
            img.DrawLines(pen, points);

            Assert.NotEmpty(img.ProcessorApplications);
            DrawPathProcessor <Rgba32> processor = Assert.IsType <DrawPathProcessor <Rgba32> >(img.ProcessorApplications[0].processor);

            Assert.Equal(GraphicsOptions.Default, processor.Options);

            ShapePath path = Assert.IsType <ShapePath>(processor.Path);

            SixLabors.Shapes.Path vector  = Assert.IsType <SixLabors.Shapes.Path>(path.Path);
            LinearLineSegment     segment = Assert.IsType <LinearLineSegment>(vector.LineSegments[0]);

            Assert.Equal(pen, processor.Pen);
        }
コード例 #26
0
        public void CorrectlySetsBrushThicknessAndPath()
        {
            img.Draw(brush, thickness, path);

            Assert.NotEmpty(img.ProcessorApplications);
            DrawPathProcessor <Rgba32> processor = Assert.IsType <DrawPathProcessor <Rgba32> >(img.ProcessorApplications[0].processor);

            Assert.Equal(GraphicsOptions.Default, processor.Options);

            ShapePath shapepath = Assert.IsType <ShapePath>(processor.Path);

            Assert.Equal(path, shapepath.Path);

            Pen <Rgba32> pen = Assert.IsType <Pen <Rgba32> >(processor.Pen);

            Assert.Equal(brush, pen.Brush);
            Assert.Equal(thickness, pen.Width);
        }
コード例 #27
0
        public void CorrectlySetsBrushThicknessPathAndOptions()
        {
            img.Draw(brush, thickness, path, noneDefault);

            Assert.NotEmpty(img.ProcessorApplications);
            DrawPathProcessor <Color> processor = Assert.IsType <DrawPathProcessor <Color> >(img.ProcessorApplications[0].processor);

            Assert.Equal(noneDefault, processor.Options);

            ShapePath shapepath = Assert.IsType <ShapePath>(processor.Path);

            Assert.Equal(path, shapepath.Path);

            Pen <Color> pen = Assert.IsType <Pen <Color> >(processor.Pen);

            Assert.Equal(brush, pen.Brush);
            Assert.Equal(thickness, pen.Width);
        }
コード例 #28
0
        public void CorrectlySetsBrushThicknessAndPoints()
        {
            img.DrawPolygon(brush, thickness, points);

            Assert.NotEmpty(img.ProcessorApplications);
            DrawPathProcessor <Color> processor = Assert.IsType <DrawPathProcessor <Color> >(img.ProcessorApplications[0].processor);

            Assert.Equal(GraphicsOptions.Default, processor.Options);

            ShapePath path = Assert.IsType <ShapePath>(processor.Path);

            Polygon           vector  = Assert.IsType <SixLabors.Shapes.Polygon>(path.Path);
            LinearLineSegment segment = Assert.IsType <LinearLineSegment>(vector.LineSegments[0]);

            Pen <Color> pen = Assert.IsType <Pen <Color> >(processor.Pen);

            Assert.Equal(brush, pen.Brush);
            Assert.Equal(thickness, pen.Width);
        }
コード例 #29
0
        public void CorrectlySetsBrushThicknessPointsAndOptions()
        {
            img.DrawLines(brush, thickness, points, noneDefault);

            Assert.NotEmpty(img.ProcessorApplications);
            DrawPathProcessor <Rgba32> processor = Assert.IsType <DrawPathProcessor <Rgba32> >(img.ProcessorApplications[0].processor);

            Assert.Equal(noneDefault, processor.Options);

            ShapePath path = Assert.IsType <ShapePath>(processor.Path);

            SixLabors.Shapes.Path vector  = Assert.IsType <SixLabors.Shapes.Path>(path.Path);
            LinearLineSegment     segment = Assert.IsType <LinearLineSegment>(vector.LineSegments[0]);

            Pen <Rgba32> pen = Assert.IsType <Pen <Rgba32> >(processor.Pen);

            Assert.Equal(brush, pen.Brush);
            Assert.Equal(thickness, pen.Width);
        }
コード例 #30
0
        public void CorrectlySetsPenRectangleAndOptions()
        {
            img.Draw(pen, rectangle, noneDefault);

            Assert.NotEmpty(img.ProcessorApplications);
            DrawPathProcessor <Rgba32> processor = Assert.IsType <DrawPathProcessor <Rgba32> >(img.ProcessorApplications[0].processor);

            Assert.Equal(noneDefault, processor.Options);

            ShapePath shapepath = Assert.IsType <ShapePath>(processor.Path);

            SixLabors.Shapes.Rectangle rect = Assert.IsType <SixLabors.Shapes.Rectangle>(shapepath.Path);

            Assert.Equal(rect.Location.X, rectangle.X);
            Assert.Equal(rect.Location.Y, rectangle.Y);
            Assert.Equal(rect.Size.Width, rectangle.Width);
            Assert.Equal(rect.Size.Height, rectangle.Height);

            Assert.Equal(pen, processor.Pen);
        }