Пример #1
0
        public void ShouldGetValue()
        {
            var entity = new Entity {
                Sample = 5
            };
            var adapter = new DependencyPropertyAdapter(entity, Entity.SampleProperty);
            var value   = adapter.GetValue();

            Assert.AreEqual(5, value);
        }
Пример #2
0
        public void ShouldGetValueFromAttachedProperty()
        {
            var entity  = new Entity();
            var adapter = new DependencyPropertyAdapter(entity, Other.AttachedProperty);

            Other.SetAttached(entity, 5);

            var value = adapter.GetValue();

            Assert.AreEqual(5, value);
        }