From 2bd730b4416ea12f3fd5a4a48beca56d6a1432a9 Mon Sep 17 00:00:00 2001 From: Till Schneidereit Date: Wed, 4 Jan 2012 13:51:22 +0100 Subject: [PATCH] Moves two tests into the correct class (from ReflectorTests into InjectorTests) --- test/org/swiftsuspenders/InjectorTests.as | 21 ++++++++++++++++++++- test/org/swiftsuspenders/ReflectorTests.as | 20 +------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/test/org/swiftsuspenders/InjectorTests.as b/test/org/swiftsuspenders/InjectorTests.as index 130819d..f0b9274 100644 --- a/test/org/swiftsuspenders/InjectorTests.as +++ b/test/org/swiftsuspenders/InjectorTests.as @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 the original author or authors + * Copyright (c) 2012 the original author or authors * * Permission is hereby granted to use, modify, and distribute this file * in accordance with the terms of the license agreement accompanying it. @@ -40,6 +40,7 @@ package org.swiftsuspenders import org.swiftsuspenders.support.injectees.OptionalClassInjectee; import org.swiftsuspenders.support.injectees.OptionalOneRequiredParameterMethodInjectee; import org.swiftsuspenders.support.injectees.OrderedPostConstructInjectee; + import org.swiftsuspenders.support.injectees.PostConstructInjectedVarInjectee; import org.swiftsuspenders.support.injectees.PostConstructWithArgInjectee; import org.swiftsuspenders.support.injectees.RecursiveInterfaceInjectee; import org.swiftsuspenders.support.injectees.SetterInjectee; @@ -882,5 +883,23 @@ package org.swiftsuspenders injector.getInstance(PostConstructWithArgInjectee); assertThat(injectee.property, isA(Clazz)); } + + [Test] + public function injectorExecutesInjectedPostConstructMethodVars() : void + { + var callbackInvoked : Boolean; + injector.map(Function).toValue(function() : void {callbackInvoked = true}); + injector.getInstance(PostConstructInjectedVarInjectee); + assertThat(callbackInvoked, isTrue()); + } + + [Test] + public function injectorExecutesInjectedPostConstructMethodVarsInInjecteeScope() : void + { + injector.map(Function).toValue(function() : void {this.property = new Clazz();}); + const injectee : PostConstructInjectedVarInjectee = + injector.getInstance(PostConstructInjectedVarInjectee); + assertThat(injectee.property, isA(Clazz)); + } } } \ No newline at end of file diff --git a/test/org/swiftsuspenders/ReflectorTests.as b/test/org/swiftsuspenders/ReflectorTests.as index 86457c6..d89dee3 100644 --- a/test/org/swiftsuspenders/ReflectorTests.as +++ b/test/org/swiftsuspenders/ReflectorTests.as @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 the original author or authors + * Copyright (c) 2012 the original author or authors * * Permission is hereby granted to use, modify, and distribute this file * in accordance with the terms of the license agreement accompanying it. @@ -351,23 +351,5 @@ package org.swiftsuspenders reflector.describeInjections(PostConstructGetterInjectee).injectionPoints); assertThat(first, notNullValue()); } - - [Test] - public function injectorExecutesInjectedPostConstructMethodVars() : void - { - var callbackInvoked : Boolean; - injector.map(Function).toValue(function() : void {callbackInvoked = true}); - injector.getInstance(PostConstructInjectedVarInjectee); - assertThat(callbackInvoked, isTrue()); - } - - [Test] - public function injectorExecutesInjectedPostConstructMethodVarsInInjecteeScope() : void - { - injector.map(Function).toValue(function() : void {this.property = new Clazz();}); - const injectee : PostConstructInjectedVarInjectee = - injector.getInstance(PostConstructInjectedVarInjectee); - assertThat(injectee.property, isA(Clazz)); - } } }