TextBlockTests.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 System.Threading.Tasks;
  4. using Avalonia.Controls;
  5. using Avalonia.Layout;
  6. using Avalonia.Media;
  7. using Xunit;
  8. #if AVALONIA_SKIA
  9. namespace Avalonia.Skia.RenderTests
  10. #else
  11. namespace Avalonia.Direct2D1.RenderTests.Controls
  12. #endif
  13. {
  14. public class TextBlockTests : TestBase
  15. {
  16. public TextBlockTests()
  17. : base(@"Controls\TextBlock")
  18. {
  19. }
  20. [Fact]
  21. public async Task Wrapping_NoWrap()
  22. {
  23. Decorator target = new Decorator
  24. {
  25. Padding = new Thickness(8),
  26. Width = 200,
  27. Height = 200,
  28. Child = new TextBlock
  29. {
  30. Background = Brushes.Red,
  31. FontSize = 12,
  32. Foreground = Brushes.Black,
  33. Text = "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit",
  34. VerticalAlignment = VerticalAlignment.Top,
  35. TextWrapping = TextWrapping.NoWrap,
  36. }
  37. };
  38. await RenderToFile(target);
  39. CompareImages();
  40. }
  41. }
  42. }