FormattedTextTests.cs 719 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using Avalonia.Media;
  3. using Xunit;
  4. namespace Avalonia.Visuals.UnitTests.Media
  5. {
  6. public class FormattedTextTests
  7. {
  8. [Fact]
  9. public void Exception_Should_Be_Thrown_If_FontSize_0()
  10. {
  11. Assert.Throws<ArgumentException>(() => new FormattedText(
  12. "foo",
  13. "Ariel",
  14. 0,
  15. Size.Infinity));
  16. }
  17. [Fact]
  18. public void Exception_Should_Be_Thrown_If_FontWeight_0()
  19. {
  20. Assert.Throws<ArgumentException>(() => new FormattedText(
  21. "foo",
  22. "Ariel",
  23. 12,
  24. Size.Infinity,
  25. fontWeight: 0));
  26. }
  27. }
  28. }