Esempio n. 1
0
        public void Merger_RunningMergeOnFontAndColor_SystemAndXNamespacesExists()
        {
            var res = XamlFileMerger.MergeXamlFiles(GetFontResource(), GetColorResource());
            IEnumerable <XAttribute> attributes = res.Attributes();
            var xmlns       = attributes.First(attr => attr.Name == "xmlns");
            var x           = attributes.First(attr => attr.Name.LocalName == "x");
            var system      = attributes.First(attr => attr.Name.LocalName == "system");
            var collections = attributes.First(attr => attr.Name.LocalName == "collections");

            Assert.AreEqual("http://schemas.microsoft.com/winfx/2006/xaml/presentation", xmlns.Value);
            Assert.AreEqual("http://schemas.microsoft.com/winfx/2006/xaml", x.Value);
            Assert.AreEqual("clr-namespace:System;assembly=mscorlib", system.Value);
            Assert.AreEqual("clr-namespace:System.Collections;assembly=mscorlib", collections.Value);
        }
Esempio n. 2
0
        public void Merger_RunningMergeOnFontAndColor_AllelementsIncluded()
        {
            var res = XamlFileMerger.MergeXamlFiles(GetFontResource(), GetColorResource());
            IEnumerable <XElement> elements = res.Elements();

            var brushRed       = GetAttributeWithKey(elements, "Brush.Red");
            var fontSizeMedium = GetAttributeWithKey(elements, "FontSize.Medium");
            var fontSizeLarge  = GetAttributeWithKey(elements, "FontSize.Large");

            var elementsAsList      = elements.ToList();
            int brushRedIndex       = elementsAsList.IndexOf(brushRed);
            int fontSizeMediumIndex = elementsAsList.IndexOf(fontSizeMedium);
            int fontSizeLargeIndex  = elementsAsList.IndexOf(fontSizeLarge);

            Assert.IsTrue(fontSizeLargeIndex > fontSizeMediumIndex);
            Assert.IsTrue(brushRedIndex > fontSizeLargeIndex);
        }
Esempio n. 3
0
 public void Merger_RunningMergeOnFontAndColor_NoException()
 {
     XamlFileMerger.MergeXamlFiles(GetFontResource(), GetColorResource());
 }
Esempio n. 4
0
 public void Merger_RunningMergeOnNull_ExceptionIsThrown()
 {
     XamlFileMerger.MergeXamlFiles(null, null);
 }