-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
fmi-base/src/test/kotlin/no/ntnu/ihb/fmi4j/modeldescription/misc/CalculatedParameterTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package no.ntnu.ihb.fmi4j.modeldescription.misc | ||
|
||
import no.ntnu.ihb.fmi4j.modeldescription.ModelDescriptionParser | ||
import no.ntnu.ihb.fmi4j.modeldescription.variables.Causality | ||
import org.junit.jupiter.api.Assertions | ||
import org.junit.jupiter.api.Test | ||
|
||
class CalculatedParameterTest { | ||
|
||
val xml = """ | ||
<?xml version="1.0" encoding="ISO-8859-1"?> | ||
<fmiModelDescription fmiVersion="2.0" modelName="Test" guid="1234"> | ||
<CoSimulation modelIdentifier="test"></CoSimulation> | ||
<ModelVariables> | ||
<ScalarVariable name="myvar" valueReference="1" causality="calculatedParameter"> | ||
<Real /> | ||
</ScalarVariable> | ||
</ModelVariables> | ||
<ModelStructure> | ||
</ModelStructure> | ||
</fmiModelDescription> | ||
""".trimIndent() | ||
|
||
@Test | ||
fun test() { | ||
|
||
ModelDescriptionParser.parseModelDescription(xml).also { | ||
it.asCoSimulationModelDescription().modelVariables.forEach { | ||
Assertions.assertEquals(Causality.CALCULATED_PARAMETER, it.causality) | ||
} | ||
} | ||
|
||
} | ||
|
||
} |