Ejemplo n.º 1
0
        public void ShouldClearValue()
        {
            BusinessObject component = new BusinessObject() { Name = "TestName" };
              PropertyItem property = new PropertyItem(new PropertyGrid(), component, BusinessObject.ExtractProperty("Name"));

              Assert.AreEqual<string>("TestName", property.GetValue().ToString());

              property.ClearValue();

              Assert.AreEqual<string>("DefaultName", property.GetValue().ToString());
        }
Ejemplo n.º 2
0
        public void ShouldClearValue()
        {
            BusinessObject component = new BusinessObject()
            {
                Name = "TestName"
            };
            PropertyItem property = new PropertyItem(new PropertyGrid(), component, BusinessObject.ExtractProperty("Name"));

            Assert.AreEqual <string>("TestName", property.GetValue().ToString());

            property.ClearValue();

            Assert.AreEqual <string>("DefaultName", property.GetValue().ToString());
        }
Ejemplo n.º 3
0
        public void ShouldNotifyOnValueCleared()
        {
            BusinessObject component = new BusinessObject()
            {
                Name = "TestName"
            };
            PropertyItem property = new PropertyItem(new PropertyGrid(), component, BusinessObject.ExtractProperty("Name"));
            bool         cleared  = false;

            property.PropertyChanged += (sender, e) => { if (e.PropertyName == "PropertyValue")
                                                         {
                                                             cleared = true;
                                                         }
            };

            property.ClearValue();
            Assert.IsTrue(cleared);
        }
Ejemplo n.º 4
0
        public void ShouldNotifyOnValueCleared()
        {
            BusinessObject component = new BusinessObject() { Name = "TestName" };
              PropertyItem property = new PropertyItem(new PropertyGrid(), component, BusinessObject.ExtractProperty("Name"));
              bool cleared = false;
              property.PropertyChanged += (sender, e) => { if (e.PropertyName == "PropertyValue") cleared = true; };

              property.ClearValue();
              Assert.IsTrue(cleared);
        }