{
//Test Data
int stepCount = 0;
TestResult tr = new TestResult();
tr.setDescription("Change an enum parameter in a complex connected object from null to a value");
VeryComplexObjectEnumParameterEnum testEnumValue = VeryComplexObjectEnumParameterEnum.BAR;
//Test Setup
VeryComplexObjectCO complexConnectedObject = VeryComplexObjectClientCO.rootFrom(complexConnectedObjectHeap);
complexObject = new VeryComplexObject();
complexObject.setEnumParameter(testEnumValue);
if (complexConnectedObject.getEnumParameter() != null) {
updateComplexConnectedObject(client, complexConnectedObjectHeap, ctx, null);
}
assertEquals(tr, 0, null, complexConnectedObject.getEnumParameter(), "TestSetup requires ComplexConnectedObject.enumParameter = null");
//Test Steps
assertEquals(tr, ++stepCount, true, updateComplexConnectedObject(client, complexConnectedObjectHeap, ctx, complexObject), "Update ComplexConnectedObject.enumParameter = " + testEnumValue);
assertEquals(tr, ++stepCount, testEnumValue.name(), complexConnectedObject.getEnumParameter());
results.add(tr);
}
{
//Test Data
int stepCount = 0;
TestResult tr = new TestResult();
tr.setDescription("Change an enum parameter in a complex connected object from a value to another value");
VeryComplexObjectEnumParameterEnum testEnumValue = VeryComplexObjectEnumParameterEnum.FOOBAR;
//Test Setup
VeryComplexObjectCO complexConnectedObject = VeryComplexObjectClientCO.rootFrom(complexConnectedObjectHeap);
complexObject = new VeryComplexObject();
complexObject.setEnumParameter(testEnumValue);
if(complexConnectedObject.getEnumParameter() == null || complexConnectedObject.getEnumParameter().equals(testEnumValue.name()))
{
VeryComplexObject setupComplexObject = new VeryComplexObject();
if (testEnumValue == VeryComplexObjectEnumParameterEnum.BAR) {
setupComplexObject.setEnumParameter(VeryComplexObjectEnumParameterEnum.FOOBAR);
}
else {
setupComplexObject.setEnumParameter(VeryComplexObjectEnumParameterEnum.BAR);
}
updateComplexConnectedObject(client, complexConnectedObjectHeap, ctx, setupComplexObject);
}
assertNotNull(tr, 0, complexConnectedObject.getEnumParameter(), "TestSetup requires ComplexConnectedObject.enumParameter != null");
assertTrue(tr, 0, !complexConnectedObject.getEnumParameter().equals(testEnumValue.name()), "TestSetup requires complexConnectedObject.enumParameter != " + testEnumValue);
//Test Steps
assertEquals(tr, ++stepCount, true, updateComplexConnectedObject(client, complexConnectedObjectHeap, ctx, complexObject), "Update complexConnectedObject.enumParameter = " + testEnumValue);
assertEquals(tr, ++stepCount, testEnumValue.name(), complexConnectedObject.getEnumParameter(), "After Update complexConnectedObject.enumParameter");
results.add(tr);
}
{
//Test Data
int stepCount = 0;