Ejemplo n.º 1
0
        public void StringPropertyOnWeavedDecoratorReturnsBaseModelDefaultStringValue()
        {
            var model          = new BaseModel();
            var expectedResult = model.StringProperty;

            var decorator = new DecoratorModel(model);

            Assert.Equal(expectedResult, decorator.StringProperty);
        }
Ejemplo n.º 2
0
        public void DecoratorReactiveStringPropertyRaisesPropertyChanged()
        {
            var expectedPropertyChanged = "SomeCoolNewProperty";
            var resultPropertyChanged   = string.Empty;

            var decorator = new DecoratorModel(new BaseModel());

            var obj = (INotifyPropertyChanged)decorator;

            obj.PropertyChanged += (sender, args) => resultPropertyChanged = args.PropertyName;

            decorator.UpdateCoolProperty("Some Cool Property");
            Assert.Equal(expectedPropertyChanged, resultPropertyChanged);
        }
Ejemplo n.º 3
0
        public void DecoratorStringPropertyRaisesPropertyChanged()
        {
            var expectedPropertyChanged = "StringProperty";
            var resultPropertyChanged   = string.Empty;

            var decorator = new DecoratorModel(new BaseModel());

            var obj = (INotifyPropertyChanged)decorator;

            obj.PropertyChanged += (sender, args) => resultPropertyChanged = args.PropertyName;

            decorator.StringProperty = "Some New Value";

            Assert.Equal(expectedPropertyChanged, resultPropertyChanged);
        }