From 36822e614d6be3fa033410d87408c404288db4c3 Mon Sep 17 00:00:00 2001 From: Stephane Delcroix Date: Thu, 8 Sep 2016 21:01:09 +0200 Subject: [XamlC] throw exception on missing property (#336) * Added unit test for 43450 * fix test * [XamlC] instrument the compiler so we can test it * [XamlC] throw on missing property --- Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml | 15 ++++++++++ .../Issues/Bz43450.xaml.cs | 32 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml create mode 100644 Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml.cs (limited to 'Xamarin.Forms.Xaml.UnitTests/Issues') diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml new file mode 100644 index 00000000..cc234879 --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml.cs new file mode 100644 index 00000000..b3346b37 --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml.cs @@ -0,0 +1,32 @@ +using NUnit.Framework; + +namespace Xamarin.Forms.Xaml.UnitTests +{ + [XamlCompilation(XamlCompilationOptions.Skip)] + public partial class Bz43450 : ContentPage + { + public Bz43450() + { + InitializeComponent(); + } + + public Bz43450(bool useCompiledXaml) + { + //this stub will be replaced at compile time + } + + [TestFixture] + class Tests + { + [TestCase(true)] + [TestCase(false)] + public void DoesNotAllowGridRowDefinition(bool useCompiledXaml) + { + if (!useCompiledXaml) + Assert.Throws(() => new Bz43450(useCompiledXaml)); + else + Assert.Throws(() => MockCompiler.Compile(typeof(Bz43450))); + } + } + } +} \ No newline at end of file -- cgit v1.2.3