예제 #1
0
        public void Conainter_RegisterInstance_RegistrationSuccesfull()
        {
            string elem = "sapte";

            _container.Register(elem);

            var result = _container.Resolve <string>();

            Assert.AreSame(elem, result);
        }
예제 #2
0
        public void Container_KnownCtorWithConcreteParam_ResolvesSuccesfully()
        {
            ITestObj expectedTestObj = new TestObj {
                Item = ExpectedItem
            };

            _container.Register <TestObjComplex>(new KnownCtor(expectedTestObj));

            var result = _container.Resolve <TestObjComplex>();

            Assert.NotNull(result);
            Assert.AreEqual(expectedTestObj, result.Obj1);
        }