TextBlockTests.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. [Win32Fact("Has text")]
  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. FontFamily = new FontFamily("Courier New"),
  31. Background = Brushes.Red,
  32. FontSize = 12,
  33. Foreground = Brushes.Black,
  34. Text = "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit",
  35. VerticalAlignment = VerticalAlignment.Top,
  36. TextWrapping = TextWrapping.NoWrap,
  37. }
  38. };
  39. await RenderToFile(target);
  40. CompareImages();
  41. }
  42. }
  43. }