Example #1
0
        public void Should_Not_Log_Binding_Error_When_Not_Attached_To_Logical_Tree()
        {
            var target = new Decorator {
                DataContext = "foo"
            };
            var called = false;

            LogCallback checkLogMessage = (level, area, src, mt, pv) =>
            {
                if (level >= Logging.LogEventLevel.Warning)
                {
                    called = true;
                }
            };

            using (TestLogSink.Start(checkLogMessage))
            {
                target.Bind(Decorator.TagProperty, new Binding("Foo"));
            }

            Assert.False(called);
        }