summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingCtor.xaml.cs
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2016-12-04 22:08:11 +0100
committerGitHub <noreply@github.com>2016-12-04 22:08:11 +0100
commit39f2deb5e04886374e720013782c751a4bb7675d (patch)
tree64f2df7230760c26533730e73821a6dc5c7607da /Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingCtor.xaml.cs
parentfb76107f4f3294a9d32c6983bc742ce8dff60cd8 (diff)
downloadxamarin-forms-39f2deb5e04886374e720013782c751a4bb7675d.tar.gz
xamarin-forms-39f2deb5e04886374e720013782c751a4bb7675d.tar.bz2
xamarin-forms-39f2deb5e04886374e720013782c751a4bb7675d.zip
[Xaml] support arrays as x:Arguments (#545)
* [Xaml] port some FactoryMethod tests to XamlC * [Xaml] support array parameters in factory ctors * [XamlC] support arrays as x:Arguments * fix build
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingCtor.xaml.cs')
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingCtor.xaml.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingCtor.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingCtor.xaml.cs
new file mode 100644
index 00000000..6771edf6
--- /dev/null
+++ b/Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingCtor.xaml.cs
@@ -0,0 +1,35 @@
+using System;
+using NUnit.Framework;
+using Xamarin.Forms.Core.UnitTests;
+
+namespace Xamarin.Forms.Xaml.UnitTests
+{
+ [XamlCompilation(XamlCompilationOptions.Skip)]
+ public partial class FactoryMethodMissingCtor : MockView
+ {
+ public FactoryMethodMissingCtor()
+ {
+ InitializeComponent();
+ }
+
+ [TestFixture]
+ public class Tests
+ {
+ [SetUp]
+ public void SetUp()
+ {
+ Device.PlatformServices = new MockPlatformServices();
+ }
+
+ [TestCase(false)]
+ [TestCase(true)]
+ public void Throw(bool useCompiledXaml)
+ {
+ if (useCompiledXaml)
+ Assert.Throws(new XamlParseExceptionConstraint(7, 4), () => MockCompiler.Compile(typeof(FactoryMethodMissingCtor)));
+ else
+ Assert.Throws<MissingMethodException>(() => new FactoryMethodMissingCtor());
+ }
+ }
+ }
+} \ No newline at end of file