public void CopyBrushWithInstanceProvider()
        {
            SolidBrush a = new SolidBrush(Color.Red);
            SolidBrush b = (SolidBrush)a.Copy();

            Assert.AreNotSame(a, b);
        }
Exemplo n.º 2
0
        public void BrushIsCopiedWithSuppliedInstance()
        {
            SolidBrush a = new SolidBrush(Color.Black);
            SolidBrush b = new SolidBrush(Color.Red);

            a.Copy(b);

            Assert.AreNotSame(a, b);
            Assert.AreEqual(a.Color, b.Color);
        }
Exemplo n.º 3
0
        public void BrushIsCopiedWithInstanceProvider()
        {
            SolidBrushProvider.NumCalls = 0;

            SolidBrush a = new SolidBrush(Color.Red);
            SolidBrush b = (SolidBrush)a.Copy();

            Assert.AreNotSame(a, b);
            Assert.IsTrue(SolidBrushProvider.NumCalls > 0);
        }
        public void CopyWithSuppliedInstance()
        {
            SolidBrush a = new SolidBrush(Color.Red);

            a.Color = Color.Black;
            SolidBrush b = new SolidBrush(Color.Red);

            a.Copy(b);
            Assert.AreNotSame(a, b);
            Assert.AreEqual(a.Color, b.Color);

            Size sz = new Size(2, 2);

            Assert.AreEqual(4, sz.GetArea());
        }