Skip to content

Commit

Permalink
test: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Oct 28, 2024
1 parent 7834de4 commit d1396f7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/neqsim/thermo/phase/Phase.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public abstract class Phase implements PhaseInterface {
private boolean constantPhaseVolume = false;

private PhysicalPropertyModel ppm = PhysicalPropertyModel.DEFAULT;
public neqsim.physicalproperties.PhysicalPropertyHandler physicalPropertyHandler = null;
public PhysicalPropertyHandler physicalPropertyHandler = null;

protected boolean useVolumeCorrection = true;
protected double molarVolume = 1.0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package neqsim.physicalproperties.physicalpropertysystem;

import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;

public class PhysicalPropertyModelTest {
@Test
void testByName() {
assertEquals(PhysicalPropertyModel.AMINE, PhysicalPropertyModel.byName("amine"));
assertEquals(PhysicalPropertyModel.BASIC, PhysicalPropertyModel.byName("basic"));
assertEquals(PhysicalPropertyModel.CO2WATER, PhysicalPropertyModel.byName("co2water"));
assertEquals(PhysicalPropertyModel.DEFAULT, PhysicalPropertyModel.byName("default"));
assertEquals(PhysicalPropertyModel.GLYCOL, PhysicalPropertyModel.byName("glycol"));
assertEquals(PhysicalPropertyModel.WATER, PhysicalPropertyModel.byName("water"));
}


@Test
void testByValue() {
assertEquals(PhysicalPropertyModel.AMINE, PhysicalPropertyModel.byValue(3));
assertEquals(PhysicalPropertyModel.BASIC, PhysicalPropertyModel.byValue(6));
assertEquals(PhysicalPropertyModel.CO2WATER, PhysicalPropertyModel.byValue(4));
assertEquals(PhysicalPropertyModel.DEFAULT, PhysicalPropertyModel.byValue(0));
assertEquals(PhysicalPropertyModel.GLYCOL, PhysicalPropertyModel.byValue(2));
assertEquals(PhysicalPropertyModel.WATER, PhysicalPropertyModel.byValue(1));
}
}

0 comments on commit d1396f7

Please sign in to comment.