OSDN Git Service

ResourceBundleのフォールバック禁止
[mikutoga/TogaGem.git] / src / test / java / jp / sfjp / mikutoga / pmd / RigidBehaviorTypeTest.java
1 /*
2  */
3
4 package jp.sfjp.mikutoga.pmd;
5
6 import java.util.Locale;
7 import org.junit.After;
8 import org.junit.AfterClass;
9 import org.junit.Before;
10 import org.junit.BeforeClass;
11 import org.junit.Test;
12 import static org.junit.Assert.*;
13
14 /**
15  *
16  */
17 public class RigidBehaviorTypeTest {
18
19     public RigidBehaviorTypeTest() {
20     }
21
22     @BeforeClass
23     public static void setUpClass() {
24     }
25
26     @AfterClass
27     public static void tearDownClass() {
28     }
29
30     @Before
31     public void setUp() {
32     }
33
34     @After
35     public void tearDown() {
36     }
37
38     /**
39      * Test of values method, of class RigidBehaviorType.
40      */
41     @Test
42     public void testValues() {
43         System.out.println("values");
44
45         RigidBehaviorType[] array = RigidBehaviorType.values();
46
47         assertEquals(3, array.length);
48
49         assertEquals(RigidBehaviorType.FOLLOWBONE,    array[0]);
50         assertEquals(RigidBehaviorType.ONLYDYNAMICS,  array[1]);
51         assertEquals(RigidBehaviorType.BONEDDYNAMICS, array[2]);
52
53         return;
54     }
55
56     /**
57      * Test of decode method, of class RigidBehaviorType.
58      */
59     @Test
60     public void testDecode() {
61         System.out.println("decode");
62
63         assertEquals(RigidBehaviorType.FOLLOWBONE,    RigidBehaviorType.decode((byte)0x00));
64         assertEquals(RigidBehaviorType.ONLYDYNAMICS,  RigidBehaviorType.decode((byte)0x01));
65         assertEquals(RigidBehaviorType.BONEDDYNAMICS, RigidBehaviorType.decode((byte)0x02));
66
67         assertNull(RigidBehaviorType.decode((byte)0x03));
68
69         return;
70     }
71
72     /**
73      * Test of encode method, of class RigidBehaviorType.
74      */
75     @Test
76     public void testEncode() {
77         System.out.println("encode");
78
79         assertEquals(0x00, RigidBehaviorType.FOLLOWBONE.encode());
80         assertEquals(0x01, RigidBehaviorType.ONLYDYNAMICS.encode());
81         assertEquals(0x02, RigidBehaviorType.BONEDDYNAMICS.encode());
82
83         return;
84     }
85
86     /**
87      * Test of getGuiName method, of class RigidBehaviorType.
88      */
89     @Test
90     public void testGetGuiName_0args() {
91         System.out.println("getGuiName");
92
93         Locale locale = Locale.getDefault();
94
95         for(RigidBehaviorType type : RigidBehaviorType.values()){
96             assertEquals(type.getGuiName(locale), type.getGuiName());
97         }
98
99         return;
100     }
101
102     /**
103      * Test of getGuiName method, of class RigidBehaviorType.
104      */
105     @Test
106     public void testGetGuiName_Locale() {
107         System.out.println("getGuiName");
108
109         Locale locale;
110
111         locale = Locale.JAPANESE;
112         assertEquals("ボーン追従",   RigidBehaviorType.FOLLOWBONE.getGuiName(locale));
113         assertEquals("物理演算",   RigidBehaviorType.ONLYDYNAMICS.getGuiName(locale));
114         assertEquals("ボーン位置合わせ",   RigidBehaviorType.BONEDDYNAMICS.getGuiName(locale));
115
116         locale = Locale.JAPAN;
117         assertEquals("ボーン追従",   RigidBehaviorType.FOLLOWBONE.getGuiName(locale));
118
119         locale = Locale.ITALY;
120         assertEquals("static(to bone)",   RigidBehaviorType.FOLLOWBONE.getGuiName(locale));
121         assertEquals("dynamic",   RigidBehaviorType.ONLYDYNAMICS.getGuiName(locale));
122         assertEquals("bone matching",   RigidBehaviorType.BONEDDYNAMICS.getGuiName(locale));
123
124         locale = Locale.ENGLISH;
125         assertEquals("static(to bone)",   RigidBehaviorType.FOLLOWBONE.getGuiName(locale));
126
127         locale = Locale.US;
128         assertEquals("static(to bone)",   RigidBehaviorType.FOLLOWBONE.getGuiName(locale));
129
130         return;
131     }
132
133 }