use of com.gemserk.componentsengine.utils.ParametersWrapper 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.ParametersWrapper 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.ParametersWrapper 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.ParametersWrapper 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.ParametersWrapper in project commons-gdx by gemserk.
the class ParametersDelegateImplTest method shouldReturnParameterFromDelegate2.
@Test
public void shouldReturnParameterFromDelegate2() {
ParametersWrapper parameters = new ParametersWrapper();
parameters.put("a", "b");
ParametersDelegateImpl parametersDelegate = new ParametersDelegateImpl();
parametersDelegate.setDelegate(parameters);
assertEquals("b", parametersDelegate.get("a", "c"));
}
Aggregations