Skip to content
This repository has been archived by the owner on Aug 31, 2020. It is now read-only.

Commit

Permalink
More Tests Real added
Browse files Browse the repository at this point in the history
  • Loading branch information
kimbtech committed Sep 16, 2018
1 parent f677683 commit de3b6e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.kimb-technologies</groupId>
<artifactId>usf</artifactId>
<version>0.5.1</version>
<version>0.5.2</version>
<packaging>jar</packaging>
<name>usf</name>
<url>https://github.com/kimbtech/USF</url>
Expand Down
31 changes: 14 additions & 17 deletions src/test/java/eu/kimb_technologies/usf/test/RealTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,21 @@ public void testSet(){
@Test
@DisplayName("USF Export Test")
public void testToUSF() {
/*
assertEquals( iPlus.toUSF(), "100" );
assertEquals( iMinus.toUSF(), "-992" );
assertEquals( iNull.toUSF(), "0" );
*/
assertEquals( iPlus.toUSF(), "=100.11=" );
assertEquals( iMinus.toUSF(), "=-100.025=" );
assertEquals( iNull.toUSF(), "=0.0=" );
}

@Test
@DisplayName("USF Import Test")
public void testLoadUSF() throws USFSyntaxException {
/*
iNull.loadUSF("+20");
iPlus.loadUSF("20");
iMinus.loadUSF("-2");
assertEquals(iNull.getValue(), iPlus.getValue());
assertEquals(iMinus.getValue(), -2);
*/
iMinus.loadUSF("=-1.0E-4=");
iNull.loadUSF("=0.0=");
iPlus.loadUSF("=112.025=");

assertEquals(iNull.getValue(), 0.0);
assertEquals(iPlus.getValue(), 112.025);
assertEquals(iMinus.getValue(), -0.0001);
}

@Test
Expand All @@ -83,11 +81,10 @@ public void testLoadUSFEx(){

@Test
@DisplayName("Equals Test")
public void testEquals() {
/*
assertTrue( iPlus.equals( new USFInteger(100) ) );
assertFalse( iMinus.equals( new Integer(100) ) );
*/
public void testEquals() throws USFSyntaxException {
assertTrue( iPlus.equals( new Real(100.110) ) );
assertFalse( iMinus.equals( new Real(-110.025) ) );
assertEquals( new Real(), iNull );
}

@Test
Expand Down

0 comments on commit de3b6e0

Please sign in to comment.