summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests/Issues
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2016-09-08 21:01:09 +0200
committerGitHub <noreply@github.com>2016-09-08 21:01:09 +0200
commit36822e614d6be3fa033410d87408c404288db4c3 (patch)
treee2529d9f71dde4864f44d73b7a8ff4689309f25a /Xamarin.Forms.Xaml.UnitTests/Issues
parent1f84a4955c93544192f44ba6af5d3593554dc116 (diff)
downloadxamarin-forms-36822e614d6be3fa033410d87408c404288db4c3.tar.gz
xamarin-forms-36822e614d6be3fa033410d87408c404288db4c3.tar.bz2
xamarin-forms-36822e614d6be3fa033410d87408c404288db4c3.zip
[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
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/Issues')
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml15
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml.cs32
2 files changed, 47 insertions, 0 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ x:Class="Xamarin.Forms.Xaml.UnitTests.Bz43450">
+ <Grid>
+ <Grid.RowDefinition>
+ <RowDefinition Height="20"/>
+ <RowDefinition Height="*"/>
+ <RowDefinition Height="20"/>
+ </Grid.RowDefinition>
+ <BoxView BackgroundColor="Red"/>
+ <BoxView Grid.Row="1" BackgroundColor="Yellow"/>
+ <BoxView Grid.Row="2" BackgroundColor="Green"/>
+ </Grid>
+</ContentPage> \ 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<XamlParseException>(() => new Bz43450(useCompiledXaml));
+ else
+ Assert.Throws<XamlParseException>(() => MockCompiler.Compile(typeof(Bz43450)));
+ }
+ }
+ }
+} \ No newline at end of file