OSDN Git Service

tc
[chemicraft/chemicraft.git] / common / pcc / chemicraft / testcase / FormulaTest.java
index 4b116f6..6e5da59 100644 (file)
@@ -1,8 +1,9 @@
-/*
 package pcc.chemicraft.testcase;
 
 import static org.junit.Assert.*;
 
+import java.util.Arrays;
+
 import org.junit.Test;
 
 import pcc.chemicraft.util.Formula;
@@ -15,16 +16,15 @@ public class FormulaTest extends Formula {
 
        @Test
        public void test() {
-               Formula formula = new Formula("C64Si65535");
+               Formula formula = new Formula("Si10C19O211Si128C12O11Ca198");
                assertEquals("変換がおかしいです(元素)",
                                formula.getAtoms(),
-                               new String[] {"C", "Si"});
+                               new String[] {"Si", "C", "O", "Ca"});
 
                assertEquals("変換がおかしいです(元素数)",
                                formula.getAmonts(),
-                               new Integer[] {64, 65535});
+                               new Integer[] {10+128, 19+12, 211+11, 198});
 
        }
 
 }
-*/
\ No newline at end of file