Search in sources :

Example 1 with Parameters

use of com.gemserk.componentsengine.utils.Parameters in project commons-gdx by gemserk.

the class ParametersWithFallBackTest method shouldReturnObjectFromParametersFallbackIfNotFoundOnParametersWithDefaultValue.

@Test
public void shouldReturnObjectFromParametersFallbackIfNotFoundOnParametersWithDefaultValue() {
    ParametersWithFallBack parametersWithFallBack = new ParametersWithFallBack();
    Parameters parameters = new ParametersWrapper();
    parametersWithFallBack.setParameters(parameters);
    parametersWithFallBack.put("a", 100f);
    Float a = parametersWithFallBack.get("a", 500f);
    assertThat(a, IsEqual.equalTo(100f));
}
Also used : Parameters(com.gemserk.componentsengine.utils.Parameters) ParametersWrapper(com.gemserk.componentsengine.utils.ParametersWrapper) Test(org.junit.Test)

Example 2 with Parameters

use of com.gemserk.componentsengine.utils.Parameters in project commons-gdx by gemserk.

the class ParametersWithFallBackTest method shouldReturnObjectFromParametersIfFoundWithDefaultValue.

@Test
public void shouldReturnObjectFromParametersIfFoundWithDefaultValue() {
    ParametersWithFallBack parametersWithFallBack = new ParametersWithFallBack();
    Parameters parameters = new ParametersWrapper();
    parametersWithFallBack.setParameters(parameters);
    parameters.put("a", 100f);
    Float a = parametersWithFallBack.get("a", 500f);
    assertThat(a, IsEqual.equalTo(100f));
}
Also used : Parameters(com.gemserk.componentsengine.utils.Parameters) ParametersWrapper(com.gemserk.componentsengine.utils.ParametersWrapper) Test(org.junit.Test)

Example 3 with Parameters

use of com.gemserk.componentsengine.utils.Parameters in project commons-gdx by gemserk.

the class ParametersWithFallBackTest method shouldReturnDefaultValueIfObjectNotFound.

@Test
public void shouldReturnDefaultValueIfObjectNotFound() {
    ParametersWithFallBack parametersWithFallBack = new ParametersWithFallBack();
    Parameters parameters = new ParametersWrapper();
    parametersWithFallBack.setParameters(parameters);
    Float a = parametersWithFallBack.get("a", 500f);
    assertThat(a, IsEqual.equalTo(500f));
}
Also used : Parameters(com.gemserk.componentsengine.utils.Parameters) ParametersWrapper(com.gemserk.componentsengine.utils.ParametersWrapper) Test(org.junit.Test)

Example 4 with Parameters

use of com.gemserk.componentsengine.utils.Parameters in project commons-gdx by gemserk.

the class ParametersWithFallBackTest method shouldReturnObjectFromParametersIfFound.

@Test
public void shouldReturnObjectFromParametersIfFound() {
    ParametersWithFallBack parametersWithFallBack = new ParametersWithFallBack();
    Parameters parameters = new ParametersWrapper();
    parametersWithFallBack.setParameters(parameters);
    parameters.put("a", 100f);
    Float a = parametersWithFallBack.get("a");
    assertThat(a, IsEqual.equalTo(100f));
}
Also used : Parameters(com.gemserk.componentsengine.utils.Parameters) ParametersWrapper(com.gemserk.componentsengine.utils.ParametersWrapper) Test(org.junit.Test)

Example 5 with Parameters

use of com.gemserk.componentsengine.utils.Parameters in project commons-gdx by gemserk.

the class ParametersWithFallBackTest method shouldReturnObjectFromParametersFallbackIfNotFoundOnParameters.

@Test
public void shouldReturnObjectFromParametersFallbackIfNotFoundOnParameters() {
    ParametersWithFallBack parametersWithFallBack = new ParametersWithFallBack();
    Parameters parameters = new ParametersWrapper();
    parametersWithFallBack.setParameters(parameters);
    parametersWithFallBack.put("a", 100f);
    Float a = parametersWithFallBack.get("a");
    assertThat(a, IsEqual.equalTo(100f));
}
Also used : Parameters(com.gemserk.componentsengine.utils.Parameters) ParametersWrapper(com.gemserk.componentsengine.utils.ParametersWrapper) Test(org.junit.Test)

Aggregations

Parameters (com.gemserk.componentsengine.utils.Parameters)5 ParametersWrapper (com.gemserk.componentsengine.utils.ParametersWrapper)5 Test (org.junit.Test)5