mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 23:42:53 +08:00
752b1b0e30
adds PreferenceNode and PreferenceSet classes as wrappers for the W3C config.xml <preference> nodes populates a PreferenceSet @preferences member
36 lines
1.1 KiB
Java
36 lines
1.1 KiB
Java
import org.junit.*;
|
|
import static org.junit.Assert.*;
|
|
|
|
import com.phonegap.PreferenceNode;
|
|
|
|
public class PreferenceNodeTest {
|
|
@Test
|
|
public void testConstructor() {
|
|
PreferenceNode foo = new com.phonegap.PreferenceNode("fullscreen", "false", false);
|
|
assertEquals("fullscreen", foo.name);
|
|
assertEquals("false", foo.value);
|
|
assertEquals(false, foo.readonly);
|
|
}
|
|
|
|
@Test
|
|
public void testNameAssignment() {
|
|
PreferenceNode foo = new com.phonegap.PreferenceNode("fullscreen", "false", false);
|
|
foo.name = "widescreen";
|
|
assertEquals("widescreen", foo.name);
|
|
}
|
|
|
|
@Test
|
|
public void testValueAssignment() {
|
|
PreferenceNode foo = new com.phonegap.PreferenceNode("fullscreen", "false", false);
|
|
foo.value = "maybe";
|
|
assertEquals("maybe", foo.value);
|
|
}
|
|
|
|
@Test
|
|
public void testReadonlyAssignment() {
|
|
PreferenceNode foo = new com.phonegap.PreferenceNode("fullscreen", "false", false);
|
|
foo.readonly = true;
|
|
assertEquals(true, foo.readonly);
|
|
}
|
|
}
|