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));
}
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));
}
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));
}
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));
}
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));
}
Aggregations