public void ChangeYOffset() { PreviewControl preview = new PreviewControl(); preview.OffsetY = 3.0; Assert.AreEqual(3.0, (double)preview.GetValue(Canvas.TopProperty), "OffsetY should have set the canvas's Top property."); }
public void ChangeXOffset() { PreviewControl preview = new PreviewControl(); preview.OffsetX = 2.0; Assert.AreEqual(2.0, (double)preview.GetValue(Canvas.LeftProperty), "OffsetX should have set the canvas's Left property."); }
public void BindToValidGridSplitter() { Grid g = GridSplitterTest.CreateGrid(2, 2, 100, 100); GridSplitter splitter = GridSplitterTest.CreateGridSplitterThroughCode(1, 1, 1, null, null, 10.0, null, HorizontalAlignment.Left, new SolidColorBrush(Colors.Cyan), true); g.Children.Add(splitter); PreviewControl preview = new PreviewControl(); this.CreateAsyncTest(g, () => preview.Bind(splitter), delegate { Assert.AreEqual(50.0, preview.Height, "Height should be half the height of the grid"); Assert.AreEqual(10.0, preview.Width, "Width should be the width of the GridSplitter"); Assert.AreEqual(50.0, (double)preview.GetValue(Canvas.LeftProperty), "Left position should be on left edge of the second column"); Assert.AreEqual(50.0, (double)preview.GetValue(Canvas.TopProperty), "Top position should be on top edge of the second row"); }); }