[Test]
public void AddRemove ()
{
- bool found = false;
TestComponent component = new TestComponent ();
_container.Add (component);
- Assert.IsNotNull (component.Site, "#1");
+ Assert.IsNotNull (component.Site, "#1");
Assert.IsTrue (_container.Contains (component), "#2");
_container.Remove (component);
#endif
}
-
[Test]
public void GetService1 ()
{
_container.Add (new TestComponent ());
}
+
+#if NET_2_0
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void ValidateName ()
+ {
+ TestContainer container = new TestContainer ();
+ TestComponent c1 = new TestComponent ();
+ container.Add (c1, "dup");
+ TestComponent c2 = new TestComponent ();
+ container.Add (c2, "dup");
+ }
+#endif
}
}
-