using Annulus; using Azimuth; using UnitTestSharp; namespace Glass.UnitTests { public class ProgressBarSliceTests : TestFixture { /// /// The right half of a 100x20 track. /// [IgnoreTest] private static ProgressBarSlice RightHalf() { return new ProgressBarSlice { Bounds = Rect.FromPositionAndSize(new Vector(50, 0), new Vector(50, 20)), TrackSize = new Vector(100, 20), }; } public class CanvasLayoutTests : TestFixture { public void ViewportRect_IsTheBounds() { CheckEqual(Rect.FromPositionAndSize(new Vector(50, 0), new Vector(50, 20)), RightHalf().CanvasLayout.ViewportRect); } public void CanvasRect_IsTheWholeTrack() { CheckEqual(Rect.FromPositionAndSize(Vector.Zero, new Vector(100, 20)), RightHalf().CanvasLayout.CanvasRect); } public void CanvasOrigin_IsTheStartOfTheTrackRatherThanOfTheBounds() { CheckEqual(Vector.Zero, RightHalf().CanvasLayout.CanvasOrigin); } } } }