Esempio n. 1
0
        public void Test_Set_Registry()
        {
            ContainerRegistry cr = new ContainerRegistry();

            ViewNotifier.SetRegistry(cr);
            Assert.That(ViewNotifier.Registry, Is.EqualTo(cr));
        }
 public void before()
 {
     container = new SupportContainer();
     registry  = new ContainerRegistry();
     registry.SetParentFinder(new SupportParentFinder());
     viewManager = new ViewManager(registry);
     ViewNotifier.SetRegistry(registry);
 }
Esempio n. 3
0
        public void Test_Register_View_Calls_View_Handler()
        {
            object expectedView = null;
            Type   expectedType = null;
            object actualView   = new object();
            Type   actualType   = actualView.GetType();

            ContainerRegistry cr = new ContainerRegistry();

            ViewNotifier.SetRegistry(cr);
            object container = new object();

            cr.SetFallbackContainer(container);
            cr.GetBinding(container).AddHandler(new CallbackViewHandler(delegate(object view, Type type)
            {
                expectedType = type;
                expectedView = view;
            }));
            ViewNotifier.RegisterView(actualView);

            Assert.That(actualView, Is.EqualTo(expectedView));
            Assert.That(actualType, Is.EqualTo(expectedType));
        }
 public void before()
 {
     registry = new ContainerRegistry();
     registry.SetParentFinder(new SupportParentFinder());
     container = new SupportContainer();
 }
        /*============================================================================*/
        /* Constructor                                                                */
        /*============================================================================*/

        public ViewManager(ContainerRegistry containerRegistry)
        {
            _registry = containerRegistry;
        }