A cross-platform UI framework for .NET
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.
 
 
 

124 lines
3.3 KiB

// -----------------------------------------------------------------------
// <copyright file="BorderTests.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Direct2D1.RenderTests.Controls
{
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Perspex.Controls;
using Perspex.Media;
[TestClass]
public class BorderTests : TestBase
{
public BorderTests()
: base(@"Controls\Border")
{
}
[TestMethod]
public void Border_1px_Border()
{
Decorator target = new Decorator
{
Padding = new Thickness(8),
Width = 200,
Height = 200,
Content = new Border
{
BorderBrush = Brushes.Black,
BorderThickness = 1,
}
};
this.RenderToFile(target);
this.CompareImages();
}
[TestMethod]
public void Border_2px_Border()
{
Decorator target = new Decorator
{
Padding = new Thickness(8),
Width = 200,
Height = 200,
Content = new Border
{
BorderBrush = Brushes.Black,
BorderThickness = 2,
}
};
this.RenderToFile(target);
this.CompareImages();
}
[TestMethod]
public void Border_Fill()
{
Decorator target = new Decorator
{
Padding = new Thickness(8),
Width = 200,
Height = 200,
Content = new Border
{
Background = Brushes.Red,
}
};
this.RenderToFile(target);
this.CompareImages();
}
[TestMethod]
public void Border_Brush_Offsets_Content()
{
Decorator target = new Decorator
{
Padding = new Thickness(8),
Width = 200,
Height = 200,
Content = new Border
{
BorderBrush = Brushes.Black,
BorderThickness = 2,
Content = new Border
{
Background = Brushes.Red,
}
}
};
this.RenderToFile(target);
this.CompareImages();
}
[TestMethod]
public void Border_Padding_Offsets_Content()
{
Decorator target = new Decorator
{
Padding = new Thickness(8),
Width = 200,
Height = 200,
Content = new Border
{
BorderBrush = Brushes.Black,
BorderThickness = 2,
Padding = new Thickness(2),
Content = new Border
{
Background = Brushes.Red,
}
}
};
this.RenderToFile(target);
this.CompareImages();
}
}
}