use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameter in project constellation by constellation-app.
the class StringParameterTypeNGTest method testIsLabel.
/**
* Test of isLabel method, of class StringParameterType.
*/
@Test
public void testIsLabel() {
System.out.println("isLabel");
PluginParameter instance = StringParameterType.build("stringParameter");
// check if when set to true it reamains true
boolean expResult = true;
instance.setProperty(StringParameterType.IS_LABEL, expResult);
boolean result = StringParameterType.isLabel(instance);
assertEquals(result, expResult);
// check if when set to false it reamains false
expResult = false;
instance.setProperty(StringParameterType.IS_LABEL, expResult);
result = StringParameterType.isLabel(instance);
assertEquals(result, expResult);
// check if when set to false it doesn't think its true
expResult = true;
instance.setProperty(StringParameterType.IS_LABEL, false);
result = StringParameterType.isLabel(instance);
assertFalse(result);
assertNotEquals(result, expResult);
// check if when set to true it doesn't think its false
expResult = false;
instance.setProperty(StringParameterType.IS_LABEL, true);
result = StringParameterType.isLabel(instance);
assertTrue(result);
assertNotEquals(result, expResult);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameter in project constellation by constellation-app.
the class FloatParameterTypeNGTest method testBuild_String.
/**
* Test of build method, of class FloatParameterType.
*/
@Test
public void testBuild_String() {
System.out.println("build");
String id = "floatParameter";
PluginParameter result = FloatParameterType.build(id);
FloatParameterType.FloatParameterValue expResult = new FloatParameterType.FloatParameterValue();
assertEquals(result.getId(), id);
assertTrue(result.getType() instanceof FloatParameterType);
assertEquals(result.getParameterValue(), expResult);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameter in project constellation by constellation-app.
the class IntegerParameterTypeNGTest method testSetStep.
/**
* Test of setStep method, of class IntegerParameterType.
*/
@Test
public void testSetStep() {
System.out.println("setStep");
// Step shouldnt be allowed to be 0
// unsure if it could be negative and go backwards?
// step shouldn't be able to be greater than maximum value
String id = "Step";
PluginParameter<IntegerParameterType.IntegerParameterValue> parameter = new PluginParameter<>(new IntegerParameterValue(), INSTANCE, id);
// step shouldn't be allowed to be 0
int step = 0;
IntegerParameterType.setStep(parameter, step);
assertEquals(parameter.getParameterValue().getStepValue(), step);
// step should be allowed to be positive
step = 6;
IntegerParameterType.setStep(parameter, step);
assertEquals(parameter.getParameterValue().getStepValue(), step);
// step shouldn't be allowed to be negative
step = -4;
IntegerParameterType.setStep(parameter, step);
assertEquals(parameter.getParameterValue().getStepValue(), step);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameter in project constellation by constellation-app.
the class IntegerParameterTypeNGTest method testSetMinimum.
/**
* Test of setMinimum method, of class IntegerParameterType.
*/
@Test
public void testSetMinimum() {
System.out.println("setMinimum");
String id = "Minimum";
PluginParameter<IntegerParameterType.IntegerParameterValue> parameter = new PluginParameter<>(new IntegerParameterValue(), INSTANCE, id);
int min = 0;
IntegerParameterType.setMinimum(parameter, min);
assertEquals(parameter.getParameterValue().getMinimumValue(), min);
min = -5;
IntegerParameterType.setMinimum(parameter, min);
assertEquals(parameter.getParameterValue().getMinimumValue(), min);
min = 64;
IntegerParameterType.setMinimum(parameter, min);
assertEquals(parameter.getParameterValue().getMinimumValue(), min);
}
use of au.gov.asd.tac.constellation.plugins.parameters.PluginParameter in project constellation by constellation-app.
the class IntegerParameterTypeNGTest method testBuild_String.
/**
* Test of build method, of class IntegerParameterType.
*/
@Test
public void testBuild_String() {
System.out.println("build");
String id = "integerParameter";
PluginParameter result = IntegerParameterType.build(id);
IntegerParameterValue expResult = new IntegerParameterValue();
assertEquals(result.getId(), id);
assertTrue(result.getType() instanceof IntegerParameterType);
assertEquals(result.getParameterValue(), expResult);
}
Aggregations