Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 81ded368a8
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (30 sloc) 1.23 kB
component extends="mxunit.framework.TestCase" {
function setup() {
variables.parent = new ioc( "", { constants = { one = 1, two = 2 } } );
variables.factory = new ioc( "", { constants = { one = "I", three = "III" } } );
variables.factory.setParent( variables.parent );
}
function shouldFindInParent() {
assertEquals( 2, variables.factory.getBean( "two" ) );
}
function shouldFindInChild() {
assertEquals( "I", variables.factory.getBean( "one" ) );
assertEquals( "III", variables.factory.getBean( "three" ) );
}
function shouldContainViaParent() {
assertTrue( variables.factory.containsBean( "two" ) );
}
function shouldGetMetadataViaParent() {
var info = variables.factory.getBeanInfo( "two" );
assertEquals( 2, info.value );
assertTrue( info.isSingleton );
}
function shouldBeSingletonViaParent() {
assertTrue( variables.factory.isSingleton( "two" ) );
}
function shouldHaveParentInMetadata() {
var info = variables.factory.getBeanInfo();
assertTrue( structKeyExists( info, "parent" ) );
assertEquals( variables.parent.getBeanInfo(), info.parent );
}
}
Jump to Line
Something went wrong with that request. Please try again.