Esempio n. 1
0
            public void Bz59818(bool useCompiledXaml, bool xamlDoubleImplicitOpHack)
            {
                mockDeviceInfo.Platform = DevicePlatform.iOS;

                StaticResourceExtension.XamlDoubleImplicitOperation = xamlDoubleImplicitOpHack;

                if (!xamlDoubleImplicitOpHack)
                {
                    if (useCompiledXaml)
                    {
                        Assert.Throws <InvalidCastException>(() => new Bz59818(useCompiledXaml));
                    }
                    else
                    {
                        Assert.Throws <XamlParseException>(() => new Bz59818(useCompiledXaml));
                    }
                }
                else
                {
                    var layout = new Bz59818(useCompiledXaml);
                    Assert.That(layout.grid.ColumnDefinitions[0].Width, Is.EqualTo(new GridLength(100)));
                }

                StaticResourceExtension.XamlDoubleImplicitOperation = false;
            }
Esempio n. 2
0
            public void Bz59818(bool useCompiledXaml, string flag)
            {
                Device.SetFlags(new List <string>(Device.Flags)
                {
                    flag
                }.AsReadOnly());

                ((MockPlatformServices)Device.PlatformServices).RuntimePlatform = Device.iOS;

                if (flag != "xamlDoubleImplicitOpHack")
                {
                    if (useCompiledXaml)
                    {
                        Assert.Throws <InvalidCastException>(() => new Bz59818(useCompiledXaml));
                    }
                    else
                    {
                        Assert.Throws <XamlParseException>(() => new Bz59818(useCompiledXaml));
                    }
                    return;
                }
                var layout = new Bz59818(useCompiledXaml);

                Assert.That(layout.grid.ColumnDefinitions[0].Width, Is.EqualTo(new GridLength(100)));
            }