public void SetterStillSealedAfterRemove () { Setter s = new Setter (UIElement.OpacityProperty, 2.0); SetterBaseCollection sbc = new SetterBaseCollection (); Assert.IsFalse (sbc.IsSealed, "SetterBaseCollection.IsSealed-1"); Assert.IsFalse (s.IsSealed, "Setter.IsSealed-1"); sbc.Add (s); Assert.IsFalse (sbc.IsSealed, "SetterBaseCollection.IsSealed-2"); Assert.IsTrue (s.IsSealed, "Setter.IsSealed-2"); sbc.Remove (s); Assert.IsFalse (sbc.IsSealed, "SetterBaseCollection.IsSealed-3"); Assert.IsTrue (s.IsSealed, "Setter.IsSealed-3"); }
public void Add () { SetterBaseCollection sbc = new SetterBaseCollection (); Assert.Throws<ArgumentNullException> (delegate { sbc.Add (null); }, "Add(null)"); Assert.Throws<Exception> (delegate { sbc.Add (new Setter ()); }, "Add(Empty)"); }