コード例 #1
0
 public void TwoEllipses()
 {
     var d = new Drawing (new Size (50, 50), s => {
         s.DrawEllipse (new Point (10, 20), new Size (30, 40), Pens.Black);
         s.DrawEllipse (new Point (20, 30), new Size (40, 30), Pens.Black);
     });
     Assert.AreEqual (2, d.Graphic.Children.Count);
 }
コード例 #2
0
        public void RefreshWithFunc()
        {
            var num = 1;
            var d = new Drawing (new Size (50, 50), s => {
                for (var i = 0; i < num; i++) {
                    s.DrawEllipse (new Point (10*i, 20), new Size (30, 40), Pens.Black);
                }
            });
            Assert.AreEqual (1, d.Graphic.Children.Count);

            num = 2;
            d.Invalidate ();
            Assert.AreEqual (2, d.Graphic.Children.Count);
        }
コード例 #3
0
 public void EmptyDrawing()
 {
     var d = new Drawing (new Size (50, 50), s => {
     });
     Assert.AreEqual (0, d.Graphic.Children.Count);
 }