summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests/Validation/TypeMismatch.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/Validation/TypeMismatch.xaml.cs')
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Validation/TypeMismatch.xaml.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/Validation/TypeMismatch.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Validation/TypeMismatch.xaml.cs
new file mode 100644
index 00000000..43a4459c
--- /dev/null
+++ b/Xamarin.Forms.Xaml.UnitTests/Validation/TypeMismatch.xaml.cs
@@ -0,0 +1,32 @@
+using System;
+
+using Xamarin.Forms;
+
+using NUnit.Framework;
+
+namespace Xamarin.Forms.Xaml.UnitTests
+{
+ public partial class TypeMismatch : ContentPage
+ {
+ public TypeMismatch ()
+ {
+ InitializeComponent ();
+ }
+
+ public TypeMismatch (bool useCompiledXaml)
+ {
+ //this stub will be replaced at compile time
+ }
+
+ [TestFixture]
+ public class Tests
+ {
+ [TestCase (false)]
+// [TestCase (true)]
+ public void ThrowsOnMismatchingType (bool useCompiledXaml)
+ {
+ Assert.Throws (new XamlParseExceptionConstraint (7, 16, m => m.StartsWith ("Cannot assign property", StringComparison.Ordinal)), () => new TypeMismatch (useCompiledXaml));
+ }
+ }
+ }
+} \ No newline at end of file