public void AddValue() { Assert.AreEqual(_element.Count, 0); _element["key"] = new PListBoolean(); Assert.AreEqual(_element.Count, 1); Assert.IsNotNull(_element["key"]); }
public void GetBool() { PListBoolean element = _basicPlist.Root["BoolValueTrue"] as PListBoolean; Assert.IsNotNull(element); Assert.True(element.Value); element = _basicPlist.Root["BoolValueFalse"] as PListBoolean; Assert.IsNotNull(element); Assert.False(element.Value); }
public void RemoveValue() { Assert.AreEqual(_element.Count, 0); _element["key1"] = new PListBoolean(); _element["key2"] = new PListBoolean(); Assert.AreEqual(_element.Count, 2); _element.Remove("key1"); Assert.AreEqual(_element.Count, 1); Assert.IsTrue(_element.ContainsKey("key2")); Assert.IsFalse(_element.ContainsKey("key1")); }
protected override void DrawBool(PListBoolean element) { BoolEnum b = element.Value ? BoolEnum.Yes : BoolEnum.No; EditorGUI.BeginChangeCheck(); b = (BoolEnum)EditorGUILayout.EnumPopup(b, GUILayout.MinWidth(TYPE_WIDTH), GUILayout.MaxWidth(TYPE_WIDTH)); if (EditorGUI.EndChangeCheck()) { element.Value = b == BoolEnum.Yes; IsDirty = true; } GUILayout.FlexibleSpace(); }
public void SetBool() { var plist = new PList(); string newKey = "NewBool"; Assert.IsFalse(plist.Root.ContainsKey(newKey)); PListBoolean b = new PListBoolean(); b.Value = true; plist.Root.Add(newKey, b); Assert.IsTrue(plist.Root.ContainsKey(newKey)); var b2 = plist.Root[newKey] as PListBoolean; Assert.IsNotNull(b2); Assert.IsTrue(b2.Value); }
protected abstract void DrawBool(PListBoolean element);
public void SpecifiedConstructor() { PListBoolean b = new PListBoolean(true); Assert.IsTrue(b.Value); }
public void SetUp() { _element = new PListBoolean(); }
protected override void DrawBool(PListBoolean element) { Style.MinWidthLabel((element.Value ? "Yes" : "No"), PADDING); }