Beispiel #1
0
 protected override void Context()
 {
     base.Context();
     _onPropertyChangedHandler = A.Fake <PropertyChangedEventHandler>();
     sut = new ExtendedProperty <string>();
     sut.PropertyChanged += _onPropertyChangedHandler;
 }
Beispiel #2
0
        protected override void Context()
        {
            base.Context();
            var data = new ExtendedProperty <string>();

            data.ValueAsObject = "thisdata";
            sut.ExtendedProperties.Add("thisname", data);
        }
        public IExtendedProperty Clone()
        {
            var extendedProperty = new ExtendedProperty <T> {
                Name = Name, Value = Value, ReadOnly = ReadOnly, Description = Description, FullName = FullName
            };

            ListOfValues.Each(property => extendedProperty.AddToListOfValues(property));
            return(extendedProperty);
        }
Beispiel #4
0
 protected override void Context()
 {
     base.Context();
     sut = new ExtendedProperty <string>();
     sut.AddToListOfValues("new");
     sut.AddToListOfValues("string");
     sut.AddToListOfValues("value");
     sut.Value = "new";
 }
Beispiel #5
0
 protected override void Context()
 {
     base.Context();
     _onPropertyChangedHandler = A.Fake <PropertyChangedEventHandler>();
     // order here so that handler is not triggered for assignment of display name
     sut = new ExtendedProperty <string> {
         FullName = "TheDisplayName"
     };
     sut.PropertyChanged += _onPropertyChangedHandler;
 }
Beispiel #6
0
        public ExtendedProperty <U> Property <U>(Expression <Func <T, U> > exp)
        {
            var key = getKey(exp);

            if (_extendedProperties.Contains(key))
            {
                return(_extendedProperties[key].DowncastTo <ExtendedProperty <U> >());
            }

            var extendedProperty = new ExtendedProperty <U>
            {
                Name          = key,
                ValueAsObject = default(U)
            };

            _extendedProperties.Add(extendedProperty);
            return(_extendedProperties[key].DowncastTo <ExtendedProperty <U> >());
        }
Beispiel #7
0
 public void the_list_of_objects_should_not_throw_an_exception()
 {
     sut = new ExtendedProperty <bool>();
     sut.ListOfValuesAsObjects.ShouldBeEmpty();
 }