Example #1
0
        public void TestLifecycleTransient()
        {
            TestInterfaceImpl tImpl1 = ObjectBuilder.Get <TestInterface>() as TestInterfaceImpl;

            tImpl1.HelloMessage = "Poda Panni";

            TestInterfaceImpl tImpl2 = ObjectBuilder.Get <TestInterface>() as TestInterfaceImpl;

            Assert.AreNotSame(tImpl1, tImpl2, "Same object returned");
            Assert.AreNotEqual(tImpl1.HelloMessage, tImpl2.HelloMessage, "Same Object content");
        }
Example #2
0
        public void CanUseAnonymousServices()
        {
            TestInterfaceImpl tImpl = ObjectBuilder.Get <TestInterface>() as TestInterfaceImpl;

            Assert.IsNotNull(tImpl, "Did not retrieve anonymous service TestInterface");
            Assert.IsNotNull(tImpl.Sender, "Got the sender object");
            Assert.IsNotNull(tImpl.HelloMessage, "Got the string");

            SecondAnonymousServiceImpl sImpl =
                ObjectBuilder.Get <SecondAnonymousService>() as SecondAnonymousServiceImpl;

            Assert.IsNotNull(sImpl, "Second Implementation could not be got");
        }