Browse Source

Added a Path test.

pull/4/head
Steven Kirk 12 years ago
parent
commit
6b20bc7349
  1. 1
      Perspex.Direct2D1.RenderTests/Perspex.Direct2D1.RenderTests.csproj
  2. 45
      Perspex.Direct2D1.RenderTests/Shapes/PathTests.cs
  3. 2
      Perspex.Direct2D1.RenderTests/Shapes/RectangleTests.cs

1
Perspex.Direct2D1.RenderTests/Perspex.Direct2D1.RenderTests.csproj

@ -60,6 +60,7 @@
<ItemGroup>
<Compile Include="Controls\ImageTests.cs" />
<Compile Include="Controls\BorderTests.cs" />
<Compile Include="Shapes\PathTests.cs" />
<Compile Include="Shapes\RectangleTests.cs" />
<Compile Include="TestBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

45
Perspex.Direct2D1.RenderTests/Shapes/PathTests.cs

@ -0,0 +1,45 @@
// -----------------------------------------------------------------------
// <copyright file="PathTests.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Direct2D1.RenderTests.Shapes
{
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Perspex.Controls;
using Perspex.Layout;
using Perspex.Media;
using Perspex.Shapes;
[TestClass]
public class PathTests : TestBase
{
public PathTests()
: base(@"Shapes\Path")
{
}
[TestMethod]
public void Path_100px_Triangle_Centered()
{
Decorator target = new Decorator
{
Width = 200,
Height = 200,
Content = new Path
{
Fill = Brushes.Gray,
Stroke = Brushes.Red,
StrokeThickness = 2,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Data = StreamGeometry.Parse("M 0,100 L 100,100 50,0 Z"),
}
};
this.RenderToFile(target);
this.CompareImages();
}
}
}

2
Perspex.Direct2D1.RenderTests/Shapes/RectangleTests.cs

@ -1,5 +1,5 @@
// -----------------------------------------------------------------------
// <copyright file="BorderTests.cs" company="Steven Kirk">
// <copyright file="RectangleTests.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------

Loading…
Cancel
Save