static void testListOfRemove(ListOf lof, SBase s)
{
string ename = s.getElementName();
lof.append(s);
SBase c = lof.get(0);
if ( c is CompartmentType ) { CompartmentType x = (lof as ListOfCompartmentTypes).remove(0); c = x; }
else if ( c is Compartment ) { Compartment x = (lof as ListOfCompartments).remove(0); c = x; }
else if ( c is Constraint ) { Constraint x = (lof as ListOfConstraints).remove(0); c = x; }
else if ( c is EventAssignment ) { EventAssignment x = (lof as ListOfEventAssignments).remove(0); c = x; }
else if ( c is Event ) { Event x = (lof as ListOfEvents).remove(0); c = x; }
else if ( c is FunctionDefinition ) { FunctionDefinition x = (lof as ListOfFunctionDefinitions).remove(0); c = x; }
else if ( c is InitialAssignment ) { InitialAssignment x = (lof as ListOfInitialAssignments).remove(0); c = x; }
else if ( c is Parameter ) { Parameter x = (lof as ListOfParameters).remove(0); c = x; }
else if ( c is Reaction ) { Reaction x = (lof as ListOfReactions).remove(0); c = x; }
else if ( c is Rule ) { Rule x = (lof as ListOfRules).remove(0); c = x; }
else if ( c is Species ) { Species x = (lof as ListOfSpecies).remove(0); c = x; }
else if ( c is SpeciesReference ) {SimpleSpeciesReference x = (lof as ListOfSpeciesReferences).remove(0); c = x; }
else if ( c is SpeciesType ) { SpeciesType x = (lof as ListOfSpeciesTypes).remove(0); c = x; }
else if ( c is UnitDefinition ) { UnitDefinition x = (lof as ListOfUnitDefinitions).remove(0); c = x; }
else if ( c is Unit ) { Unit x = (lof as ListOfUnits).remove(0); c = x; }
else
{
ERR("[testListOfRemove] Error: (" + ename + ") : ListOfXXX::remove() failed.");
return;
}
if ( c == null)
{
ERR("[testListOfRemove] Error: (" + ename + ") : ListOfXXX::remove() failed.");
return;
}
string enameGet = c.getElementName();
if ( ename == enameGet )
{
//Console.Out.WriteLine("[testListOfRemove] OK: (" + ename + ") remove(" + enameGet + ") : type match.");
OK();
}
else
{
ERR("[testListOfRemove] Error: (" + ename + ") remove(" + enameGet + ") : type mismatch.");
}
}