Ejemplo n.º 1
0
        public void SetUp()
        {
            lifecycle = new SingletonLifecycle();

            disposable1 = new StubDisposable();
            disposable2 = new StubDisposable();

            pipeline = new RootPipelineGraph(new PluginGraph());

            lifecycle.FindCache(pipeline).As<LifecycleObjectCache>().Set(typeof (IGateway), new StubInstance("a"), disposable1);
            lifecycle.FindCache(pipeline).As<LifecycleObjectCache>().Set(typeof(IGateway), new StubInstance("b"), disposable2);
            lifecycle.FindCache(pipeline).As<LifecycleObjectCache>().Set(typeof(IGateway), new StubInstance("c"), new object());

            lifecycle.EjectAll(pipeline);
        }
Ejemplo n.º 2
0
        public when_the_singleton_Lifecycle_ejects_all()
        {
            lifecycle = new SingletonLifecycle();

            disposable1 = new StubDisposable();
            disposable2 = new StubDisposable();

            pipeline = PipelineGraph.BuildRoot(PluginGraph.CreateRoot());

            lifecycle.FindCache(pipeline)
                .As<LifecycleObjectCache>()
                .Set(typeof(IGateway), new StubInstance("a"), disposable1);
            lifecycle.FindCache(pipeline)
                .As<LifecycleObjectCache>()
                .Set(typeof(IGateway), new StubInstance("b"), disposable2);
            lifecycle.FindCache(pipeline)
                .As<LifecycleObjectCache>()
                .Set(typeof(IGateway), new StubInstance("c"), new object());

            lifecycle.EjectAll(pipeline);
        }
Ejemplo n.º 3
0
        public void SetUp()
        {
            lifecycle = new SingletonLifecycle();

            disposable1 = new StubDisposable();
            disposable2 = new StubDisposable();

            lifecycle.FindCache().Set(typeof (IGateway), new StubInstance("a"), disposable1);
            lifecycle.FindCache().Set(typeof (IGateway), new StubInstance("b"), disposable2);
            lifecycle.FindCache().Set(typeof (IGateway), new StubInstance("c"), new object());

            lifecycle.EjectAll();
        }