public void Transparent () { SolidBrush sb = new SolidBrush (Color.Transparent); Assert.AreEqual (Color.Transparent, sb.Color, "Color"); sb.Color = Color.Empty; SolidBrush clone = (SolidBrush) sb.Clone (); sb.Dispose (); Assert.AreEqual (Color.Empty.ToArgb (), clone.Color.ToArgb (), "Clone.Color"); }
public void Dispose_Clone () { SolidBrush sb = new SolidBrush (Color.Transparent); sb.Dispose (); sb.Clone (); }
public void Clone () { using (SolidBrush sb = new SolidBrush (Color.Transparent)) { // we still get a "named" color Assert.AreEqual (Color.Transparent, sb.Color, "Color"); using (SolidBrush clone = (SolidBrush) sb.Clone ()) { // but not after cloning the brush Assert.IsFalse (Color.Transparent.Equals (clone.Color), "Color-Clone-Unnamed"); Assert.AreEqual (Color.Transparent.ToArgb (), clone.Color.ToArgb (), "Color-Clone-Argb"); } } }