public void TestInfo()
        {
            Object instance = new DummyHttpServer();

            ReflectionInvokerStrategy strategy = new ReflectionInvokerStrategy();
            MDynamicSupport dynamic = strategy.Create(instance);
            AssertNotNull(dynamic);
            AssertNotNull(dynamic.Info);
            AssertEquals( 3, dynamic.Info.Operations.Count );
            AssertEquals( 1, dynamic.Info.Attributes.Count );
        }
        public void TestOperation()
        {
            DummyHttpServer instance = new DummyHttpServer();

            CodeGenerationInvokerStrategy strategy = new CodeGenerationInvokerStrategy();
            MDynamicSupport dynamic = strategy.Create(instance);

            Assert( !instance.Started );
            dynamic.Invoke("Start", null, null);
            Assert( instance.Started );
        }
        public void TestUse()
        {
            MDefaultRegistry registry = new MDefaultRegistry(new MDefaultServer());
            AssertEquals( 0, registry.Count );

            DummyHttpServer instance = new DummyHttpServer();
            ManagedObjectName name = new ManagedObjectName("domain.org");

            ManagedInstance minstance =
                registry.RegisterManagedObject(instance, name);

            AssertNotNull( minstance );
            AssertNotNull( minstance.TypeName );
            AssertEquals( name, minstance.Name );
            AssertEquals( 1, registry.Count );
            AssertEquals( instance, registry[name] );

            registry.UnregisterManagedObject( name );

            AssertEquals( 0, registry.Count );
        }