Beispiel #1
0
        public void TestNewProperty()
        {
            var obj = new TestPropertyChangedObject();

            List <string> propertiesChanged = new List <string>();

            obj.PropertyChanged += (o, e) => propertiesChanged.Add(e.PropertyName);

            obj.NewProperty = "test";
            Assert.That(propertiesChanged, Contains.Item("NewProperty"));
        }
Beispiel #2
0
        public void TestSource()
        {
            _propagator.RegisterPropertyPassThrough("ClassicProperty", "Banana");
            Assert.That(_propagator.Source, Is.SameAs(_source));

            var newSource = new TestPropertyChangedObject();

            _propagator.Source = newSource;
            Assert.That(_propagator.Source, Is.SameAs(newSource));

            _source.ClassicProperty = 6;
            Assert.That(_propertyChanged, Is.Null);

            newSource.ClassicProperty = 6;
            Assert.That(_propertyChanged, Is.EqualTo("Banana"));
        }
Beispiel #3
0
 public void Setup()
 {
     _source   = new TestPropertyChangedObject();
     _observer = new PropertyObserver <TestPropertyChangedObject>(_source);
     _observer.RegisterHandler("ClassicProperty", SourcePropertyChanged);
 }
Beispiel #4
0
        public void TestInheritance()
        {
            var obj = new TestPropertyChangedObject();

            Assert.That(obj, Is.InstanceOf <INotifyPropertyChanged>());
        }
Beispiel #5
0
 public void Setup()
 {
     _source          = new TestPropertyChangedObject();
     _propagator      = new PropertyChangedPropagator <TestPropertyChangedObject>(_source, CallbackHandler);
     _propertyChanged = null;
 }