Example #1
0
 public void AddValue()
 {
     Assert.AreEqual(_element.Count, 0);
     _element["key"] = new PListBoolean();
     Assert.AreEqual(_element.Count, 1);
     Assert.IsNotNull(_element["key"]);
 }
Example #2
0
        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);
        }
Example #3
0
 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"));
 }
Example #4
0
        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();
        }
Example #5
0
        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);
        }
Example #6
0
 protected abstract void DrawBool(PListBoolean element);
Example #7
0
        public void SpecifiedConstructor()
        {
            PListBoolean b = new PListBoolean(true);

            Assert.IsTrue(b.Value);
        }
Example #8
0
 public void SetUp()
 {
     _element = new PListBoolean();
 }
Example #9
0
 protected override void DrawBool(PListBoolean element)
 {
     Style.MinWidthLabel((element.Value ? "Yes" : "No"), PADDING);
 }