示例#1
0
        public void TestInjectorConstructorDependenciesEqualsDefined()
        {
            Injector.Clear();

            // define static user in injector
            var definedUser = new User("John", "Smith");

            Injector.Register <IUser>(definedUser);

            // compare user from injector to original
            var viewModel = InjectionResolver.InjectConstructor <CustomViewModel>(Injector);

            Assert.AreEqual(viewModel.User, definedUser);
        }
示例#2
0
        public void TestInjectorConstructorNotNull()
        {
            Injector.Clear();

            // define static user in injector
            var definedUser = new User("John", "Smith");

            Injector.Register <IUser>(definedUser);

            // compare user from injector to original
            var viewModel = InjectionResolver.InjectConstructor <CustomViewModel>(Injector);

            Assert.IsNotNull(viewModel);
        }