TextBlockTests.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (c) The Avalonia Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using Avalonia.Controls;
  4. using Avalonia.Layout;
  5. using Avalonia.Media;
  6. using Xunit;
  7. #if AVALONIA_SKIA
  8. namespace Avalonia.Skia.RenderTests
  9. #else
  10. namespace Avalonia.Direct2D1.RenderTests.Controls
  11. #endif
  12. {
  13. public class TextBlockTests : TestBase
  14. {
  15. public TextBlockTests()
  16. : base(@"Controls\TextBlock")
  17. {
  18. }
  19. [Fact]
  20. public void Wrapping_NoWrap()
  21. {
  22. Decorator target = new Decorator
  23. {
  24. Padding = new Thickness(8),
  25. Width = 200,
  26. Height = 200,
  27. Child = new TextBlock
  28. {
  29. Background = Brushes.Red,
  30. FontSize = 12,
  31. Foreground = Brushes.Black,
  32. Text = "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit",
  33. VerticalAlignment = VerticalAlignment.Top,
  34. TextWrapping = TextWrapping.NoWrap,
  35. }
  36. };
  37. RenderToFile(target);
  38. CompareImages();
  39. }
  40. }
  41. }