Example #1
0
            public void FontImageExtension_Positive(bool useCompiledXaml)
            {
                var layout = new FontImageExtension(useCompiledXaml);
                var tabs   = layout.AllChildren;

                int i = 0;

                foreach (var tab in tabs)
                {
                    Tab myTab = (Tab)tab;
                    if (myTab == null)
                    {
                        continue;
                    }

                    Assert.That(myTab.Icon, Is.TypeOf <FontImageSource>());

                    var fontImage = (FontImageSource)myTab.Icon;
                    Assert.AreEqual(FontFamily, fontImage.FontFamily);
                    Assert.AreEqual(Glyph, fontImage.Glyph);

                    if (i == 3)
                    {
                        Assert.AreEqual(30d, fontImage.Size);
                    }
                    else
                    {
                        Assert.AreEqual(Size, fontImage.Size);
                    }

                    Assert.AreEqual(Color, fontImage.Color);
                    i++;
                }
            }
Example #2
0
            public void FontImageExtension_Negative(bool useCompiledXaml)
            {
                var layout = new FontImageExtension(useCompiledXaml);
                var tabs   = layout.AllChildren;

                foreach (var tab in tabs)
                {
                    Tab myTab = (Tab)tab;
                    if (myTab == null)
                    {
                        continue;
                    }

                    Assert.That(myTab.Icon, Is.Not.TypeOf <ImageSource>());
                }
            }