Skip to content

Commit

Permalink
Moves two tests into the correct class (from ReflectorTests into Inje…
Browse files Browse the repository at this point in the history
…ctorTests)
  • Loading branch information
tschneidereit committed Jan 4, 2012
1 parent 52c13e3 commit 2bd730b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
21 changes: 20 additions & 1 deletion 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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
}
}
20 changes: 1 addition & 19 deletions 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.
Expand Down Expand Up @@ -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));
}
}
}

0 comments on commit 2bd730b

Please sign in to comment.