RelativePointTests.cs 764 B

123456789101112131415161718192021222324252627
  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.Globalization;
  4. using Xunit;
  5. namespace Avalonia.Visuals.UnitTests
  6. {
  7. public class RelativePointTests
  8. {
  9. [Fact]
  10. public void Parse_Should_Accept_Absolute_Value()
  11. {
  12. var result = RelativePoint.Parse("4,5");
  13. Assert.Equal(new RelativePoint(4, 5, RelativeUnit.Absolute), result);
  14. }
  15. [Fact]
  16. public void Parse_Should_Accept_Relative_Value()
  17. {
  18. var result = RelativePoint.Parse("25%, 50%");
  19. Assert.Equal(new RelativePoint(0.25, 0.5, RelativeUnit.Relative), result);
  20. }
  21. }
  22. }