using System; using UnitTestSharp; namespace Glass.UnitTests { public class AnchorExtensionsTests : TestFixture { public class ToOrientationTests : TestFixture { public void LeftAndRight_AreHorizontal() { CheckEqual(Orientation.Horizontal, Anchor.Left.ToOrientation()); CheckEqual(Orientation.Horizontal, Anchor.Right.ToOrientation()); } public void TopAndBottom_AreVertical() { CheckEqual(Orientation.Vertical, Anchor.Top.ToOrientation()); CheckEqual(Orientation.Vertical, Anchor.Bottom.ToOrientation()); } public void UnknownAnchor_Throws() { CheckThrow(typeof(ArgumentOutOfRangeException)); ((Anchor)99).ToOrientation(); } } public class IsAxisStartTests : TestFixture { public void LeftAndTop_AreTheStart() { CheckTrue(Anchor.Left.IsAxisStart()); CheckTrue(Anchor.Top.IsAxisStart()); } public void RightAndBottom_AreNot() { CheckFalse(Anchor.Right.IsAxisStart()); CheckFalse(Anchor.Bottom.IsAxisStart()); } public void UnknownAnchor_Throws() { CheckThrow(typeof(ArgumentOutOfRangeException)); ((Anchor)99).IsAxisStart(); } } } }