csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.3 KiB
45 lines
1.3 KiB
using Avalonia.Media;
|
|
using Xunit;
|
|
|
|
namespace Avalonia.Skia.RenderTests
|
|
{
|
|
public class GeometryDrawingTests : TestBase
|
|
{
|
|
public GeometryDrawingTests()
|
|
: base(@"Media\GeometryDrawing")
|
|
{
|
|
}
|
|
|
|
private static GeometryDrawing CreateGeometryDrawing()
|
|
{
|
|
GeometryDrawing geometryDrawing = new GeometryDrawing();
|
|
EllipseGeometry ellipse = new EllipseGeometry();
|
|
ellipse.RadiusX = 100;
|
|
ellipse.RadiusY = 100;
|
|
geometryDrawing.Geometry = ellipse;
|
|
return geometryDrawing;
|
|
}
|
|
|
|
[Fact]
|
|
public void DrawingGeometry_WithPen()
|
|
{
|
|
GeometryDrawing geometryDrawing = CreateGeometryDrawing();
|
|
geometryDrawing.Pen = new Pen(new SolidColorBrush(Color.FromArgb(255, 0, 0, 0)), 10);
|
|
|
|
Assert.Equal(210, geometryDrawing.GetBounds().Height);
|
|
Assert.Equal(210, geometryDrawing.GetBounds().Width);
|
|
|
|
}
|
|
|
|
[Fact]
|
|
public void DrawingGeometry_WithoutPen()
|
|
{
|
|
GeometryDrawing geometryDrawing = CreateGeometryDrawing();
|
|
|
|
Assert.Equal(200, geometryDrawing.GetBounds().Height);
|
|
Assert.Equal(200, geometryDrawing.GetBounds().Width);
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|