diff options
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/Issues/Bz46921.xaml.cs')
-rw-r--r-- | Xamarin.Forms.Xaml.UnitTests/Issues/Bz46921.xaml.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz46921.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz46921.xaml.cs new file mode 100644 index 00000000..4f2f04d2 --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz46921.xaml.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using NUnit.Framework; +using Xamarin.Forms; + +namespace Xamarin.Forms.Xaml.UnitTests +{ + public partial class Bz46921 : ContentPage + { + public Bz46921() + { + InitializeComponent(); + } + + public Bz46921(bool useCompiledXaml) + { + //this stub will be replaced at compile time + } + + [TestFixture] + class Tests + { + [TestCase(true)] + [TestCase(false)] + public void MultipleWaysToCreateAThicknessResource(bool useCompiledXaml) + { + var page = new Bz46921(useCompiledXaml); + foreach (var resname in new string[] { "thickness0", "thickness1", "thickness2", "thickness3", }) { + var resource = page.Resources[resname]; + Assert.That(resource, Is.TypeOf<Thickness>()); + var thickness = (Thickness)resource; + Assert.AreEqual(new Thickness(4, 20, 4, 20), thickness); + + } + } + } + } +}
\ No newline at end of file |