OSDN Git Service

tc
[chemicraft/chemicraft.git] / common / pcc / chemicraft / testcase / FormulaTest.java
1 package pcc.chemicraft.testcase;
2
3 import static org.junit.Assert.*;
4
5 import java.util.Arrays;
6
7 import org.junit.Test;
8
9 import pcc.chemicraft.util.Formula;
10
11 public class FormulaTest extends Formula {
12
13         public FormulaTest() {
14                 super("");
15         }
16
17         @Test
18         public void test() {
19                 Formula formula = new Formula("Si10C19O211Si128C12O11Ca198");
20                 assertEquals("変換がおかしいです(元素)",
21                                 formula.getAtoms(),
22                                 new String[] {"Si", "C", "O", "Ca"});
23
24                 assertEquals("変換がおかしいです(元素数)",
25                                 formula.getAmonts(),
26                                 new Integer[] {10+128, 19+12, 211+11, 198});
27
28         }
29
30 }