|
|
|
@ -8,12 +8,14 @@ namespace Perspex.SceneGraph.UnitTests |
|
|
|
{ |
|
|
|
public class RelativeRectTests |
|
|
|
{ |
|
|
|
private static readonly RelativeRectComparer Compare = new RelativeRectComparer(); |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void Parse_Should_Accept_Absolute_Value() |
|
|
|
{ |
|
|
|
var result = RelativeRect.Parse("4,5,50,60", CultureInfo.InvariantCulture); |
|
|
|
|
|
|
|
Assert.Equal(new RelativeRect(4, 5, 50, 60, RelativeUnit.Absolute), result); |
|
|
|
Assert.Equal(new RelativeRect(4, 5, 50, 60, RelativeUnit.Absolute), result, Compare); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
@ -21,7 +23,7 @@ namespace Perspex.SceneGraph.UnitTests |
|
|
|
{ |
|
|
|
var result = RelativeRect.Parse("10%, 20%, 40%, 70%", CultureInfo.InvariantCulture); |
|
|
|
|
|
|
|
Assert.Equal(new RelativeRect(0.1, 0.2, 0.4, 0.7, RelativeUnit.Relative), result); |
|
|
|
Assert.Equal(new RelativeRect(0.1, 0.2, 0.4, 0.7, RelativeUnit.Relative), result, Compare); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|