Esempio n. 1
0
        public void SetContextWithSetterTest()
        {
            var container = new ShandyGecko.ShandyGeckoDI.GeckoContainer();
            var context   = new ShandyGecko.ShandyGeckoDI.Context();

            container.RegisterInstance(new TestClass()).SetContext(context);
            Assert.AreEqual(1, context.ContainerRegistries.Count);
        }
Esempio n. 2
0
        public void ContextDisposeText()
        {
            var container = new ShandyGecko.ShandyGeckoDI.GeckoContainer();
            var context   = new ShandyGecko.ShandyGeckoDI.Context();

            container.RegisterInstance(new TestClass(), context);
            Assert.AreEqual(1, context.ContainerRegistries.Count);

            context.Dispose();
            Assert.AreEqual(0, context.ContainerRegistries.Count);
            Assert.IsFalse(container.IsKeyRegistered <TestClass>());
        }