X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem%2FTest%2FSystem.ComponentModel%2FContainerTest.cs;h=78e0f1533202f19fd387ffec94ae10cafe3be028;hb=15d9f261e9db00e41e0f9cae16bcb264f570f06a;hp=2511f6757faa8fddde473f2ddc624ec436ff83d5;hpb=d470e0ca31c5aeae86f8f2bb816eb8e2d78f6471;p=mono.git diff --git a/mcs/class/System/Test/System.ComponentModel/ContainerTest.cs b/mcs/class/System/Test/System.ComponentModel/ContainerTest.cs index 2511f6757fa..78e0f153320 100644 --- a/mcs/class/System/Test/System.ComponentModel/ContainerTest.cs +++ b/mcs/class/System/Test/System.ComponentModel/ContainerTest.cs @@ -82,11 +82,10 @@ namespace MonoTests.System.ComponentModel [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); @@ -101,12 +100,23 @@ namespace MonoTests.System.ComponentModel #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 } } -