Search in sources :

Example 1 with Options

use of se.jbee.inject.config.Options in project silk by jbee.

the class TestMultipleOptionChoicesBinds method thatMultipleOptionChoicesArePossible.

@Test
public void thatMultipleOptionChoicesArePossible() {
    Options options = Options.STANDARD.chosen(Choices.A, Choices.D);
    Globals globals = Globals.STANDARD.options(options);
    Injector injector = Bootstrap.injector(RootBundle.class, globals);
    assertEqualSets(new String[] { "A", "D" }, injector.resolve(dependency(String[].class)));
}
Also used : Globals(se.jbee.inject.config.Globals) Options(se.jbee.inject.config.Options) Injector(se.jbee.inject.Injector) Test(org.junit.Test)

Example 2 with Options

use of se.jbee.inject.config.Options in project silk by jbee.

the class TestOptionBinds method assertOptionResolvedToValue.

private static void assertOptionResolvedToValue(Machine actualOption, String expected) {
    Options options = Options.STANDARD.chosen(actualOption);
    Injector injector = Bootstrap.injector(ModularBindsBundle.class, Globals.STANDARD.options(options));
    String[] actual = injector.resolve(dependency(String[].class));
    assertArrayEquals(new String[] { expected }, actual);
}
Also used : Options(se.jbee.inject.config.Options) Injector(se.jbee.inject.Injector)

Aggregations

Injector (se.jbee.inject.Injector)2 Options (se.jbee.inject.config.Options)2 Test (org.junit.Test)1 Globals (se.jbee.inject.config.Globals)1