RectangleTests.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // -----------------------------------------------------------------------
  2. // <copyright file="RectangleTests.cs" company="Steven Kirk">
  3. // Copyright 2014 MIT Licence. See licence.md for more information.
  4. // </copyright>
  5. // -----------------------------------------------------------------------
  6. namespace Perspex.Direct2D1.RenderTests.Shapes
  7. {
  8. using Perspex.Controls;
  9. using Perspex.Controls.Shapes;
  10. using Perspex.Media;
  11. using Xunit;
  12. public class RectangleTests : TestBase
  13. {
  14. public RectangleTests()
  15. : base(@"Shapes\Rectangle")
  16. {
  17. }
  18. [Fact]
  19. public void Rectangle_1px_Stroke()
  20. {
  21. Decorator target = new Decorator
  22. {
  23. Padding = new Thickness(8),
  24. Width = 200,
  25. Height = 200,
  26. Child = new Rectangle
  27. {
  28. Stroke = Brushes.Black,
  29. StrokeThickness = 1,
  30. }
  31. };
  32. this.RenderToFile(target);
  33. this.CompareImages();
  34. }
  35. [Fact]
  36. public void Rectangle_2px_Stroke()
  37. {
  38. Decorator target = new Decorator
  39. {
  40. Padding = new Thickness(8),
  41. Width = 200,
  42. Height = 200,
  43. Child = new Rectangle
  44. {
  45. Stroke = Brushes.Black,
  46. StrokeThickness = 2,
  47. }
  48. };
  49. this.RenderToFile(target);
  50. this.CompareImages();
  51. }
  52. [Fact]
  53. public void Rectangle_Stroke_Fill()
  54. {
  55. Decorator target = new Decorator
  56. {
  57. Padding = new Thickness(8),
  58. Width = 200,
  59. Height = 200,
  60. Child = new Rectangle
  61. {
  62. Stroke = Brushes.Black,
  63. StrokeThickness = 2,
  64. Fill = Brushes.Red,
  65. }
  66. };
  67. this.RenderToFile(target);
  68. this.CompareImages();
  69. }
  70. }
  71. }