Exemple #1
0
        public void Should_rename_design_surface_elements()
        {
            var proc = new XamlPostProcessor();
            var doc  = proc.LoadDocument(XAMLTests.DesignSurfaceElement);
            var all  = doc.Document?.Root?.DescendantsAndSelf().ToArray();

            proc.RenameDesignSurfaceElements();
            Assert.AreEqual(XamlPostProcessor.ContentPageElement, doc.Document?.Root?.Name.LocalName);

            var parent = all.Any(e => e.Name.LocalName == "ContentPage.Parent");

            Assert.IsTrue(parent, "Parent");

            var other = all.Any(e => e.Name.LocalName == "Other");

            Assert.IsTrue(other, "Other");
        }