Пример #1
0
            public void SourceInfoIsRelative([Values(false)] bool useCompiledXaml)
            {
                var page = new Maui2418(useCompiledXaml);

                Assert.That(page, Is.Not.Null);
                var label0     = page.label0;
                var sourceInfo = VisualDiagnostics.GetSourceInfo(label0);

                Assert.That(sourceInfo.SourceUri.OriginalString, Is.EqualTo($"Issues{System.IO.Path.DirectorySeparatorChar}Maui2418.xaml;assembly=Microsoft.Maui.Controls.Xaml.UnitTests"));
            }
Пример #2
0
            void VTChanged(object sender, VisualTreeChangeEventArgs e)
            {
                var parentSourInfo  = e.Parent == null ? null : VisualDiagnostics.GetSourceInfo(e.Parent);
                var childSourceInfo = VisualDiagnostics.GetSourceInfo(e.Child);

                if (childSourceInfo == null)
                {
                    failures++;
                }
                if (e.Parent != null && parentSourInfo == null)
                {
                    failures++;
                }
                if (e.Parent != null && e.ChildIndex == -1)
                {
                    failures++;
                }
            }