public void SetUp() { theContext = MockRepository.GenerateMock<ILifecycleContext>(); theLifecycle = new SingletonLifecycle(); theCache = MockRepository.GenerateMock<IObjectCache>(); theContext.Stub(x => x.Singletons).Return(theCache); }
public SingletonLifecycleTester() { theContext = Substitute.For<ILifecycleContext>(); theLifecycle = new SingletonLifecycle(); theCache = Substitute.For<IObjectCache>(); theContext.Singletons.Returns(theCache); }
public void SetUp() { 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); }
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(); }