public void TestSetMaxLengthBindingWhenAttributeIsInherited()
        {
            editor.DataContext = A.Fake<object>();
            StringLengthTestClass myMockObject = new ChildStringLengthTestClass();
            Binding myBinding = new Binding("StringLengthProperty");
            myBinding.Source = myMockObject;

            editor.SetBinding(TextBox.TextProperty, myBinding);
            AttributePropertySetter.SetAttributeProperty(editor);
            Assert.Equal(50, editor.MaxLength);
        }
Example #2
0
        public void TestSetMaxLengthBindingWhenAttributeIsInherited()
        {
            editor.DataContext = Substitute.For <object>();
            StringLengthTestClass myMockObject = new ChildStringLengthTestClass();
            Binding myBinding = new Binding("StringLengthProperty")
            {
                Source = myMockObject
            };

            editor.SetBinding(TextBox.TextProperty, myBinding);
            AttributePropertySetter.SetAttributeProperty(editor);
            Assert.Equal(50, editor.MaxLength);
        }