2 // System.ComponentModel.Container test cases
5 // Gonzalo Paniagua Javier (gonzalo@ximian.com)
7 // Copyright (c) 2006 Novell, Inc. (http://www.novell.com)
10 using NUnit.Framework;
12 using System.ComponentModel;
13 using System.ComponentModel.Design;
15 namespace MonoTests.System.ComponentModel
20 class TestContainer : Container {
21 ServiceContainer _services = new ServiceContainer();
23 public TestContainer() {
24 _services.AddService( typeof(TestService), new TestService() );
27 protected override object GetService( Type serviceType ) {
28 return _services.GetService( serviceType );
32 class TestComponent : Component {
33 public override ISite Site {
40 Assert.IsNotNull (value.GetService (typeof (ISite)));
41 Assert.IsNotNull (value.GetService (typeof (TestService)));
48 public class ContainerTest {
50 public void GetService1 ()
52 TestContainer container = new TestContainer ();
53 container.Add (new TestComponent ());