From ab0fabac610b5c24c086c1cbf5e88b1d48511f2a Mon Sep 17 00:00:00 2001 From: Stephane Delcroix Date: Thu, 6 Apr 2017 23:22:50 +0200 Subject: [Xaml[C]] supports 'using:' xmlns declarations (#851) --- Xamarin.Forms.Xaml.UnitTests/TestXmlnsUsing.xaml | 9 +++++ .../TestXmlnsUsing.xaml.cs | 47 ++++++++++++++++++++++ .../Xamarin.Forms.Xaml.UnitTests.csproj | 6 +++ 3 files changed, 62 insertions(+) create mode 100644 Xamarin.Forms.Xaml.UnitTests/TestXmlnsUsing.xaml create mode 100644 Xamarin.Forms.Xaml.UnitTests/TestXmlnsUsing.xaml.cs (limited to 'Xamarin.Forms.Xaml.UnitTests') diff --git a/Xamarin.Forms.Xaml.UnitTests/TestXmlnsUsing.xaml b/Xamarin.Forms.Xaml.UnitTests/TestXmlnsUsing.xaml new file mode 100644 index 00000000..f48dfdf2 --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/TestXmlnsUsing.xaml @@ -0,0 +1,9 @@ + + + + + + diff --git a/Xamarin.Forms.Xaml.UnitTests/TestXmlnsUsing.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/TestXmlnsUsing.xaml.cs new file mode 100644 index 00000000..15eb0ff5 --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/TestXmlnsUsing.xaml.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using NUnit.Framework; +using Xamarin.Forms; +using Xamarin.Forms.Core.UnitTests; + +namespace Xamarin.Forms.Xaml.UnitTests +{ + public partial class TestXmlnsUsing : ContentPage + { + public TestXmlnsUsing() + { + InitializeComponent(); + } + + public TestXmlnsUsing(bool useCompiledXaml) + { + //this stub will be replaced at compile time + } + + [TestFixture] + class Tests + { + [SetUp] + public void Setup() + { + Device.PlatformServices = new MockPlatformServices(); + } + + [TearDown] + public void TearDown() + { + Application.Current = null; + Device.PlatformServices = null; + } + + [TestCase(true)] + [TestCase(false)] + public void SupportUsingXmlns(bool useCompiledXaml) + { + var page = new TestXmlnsUsing(useCompiledXaml); + Assert.That(page.Content, Is.Not.Null); + Assert.That(page.Content, Is.TypeOf()); + } + } + } +} diff --git a/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj b/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj index 7041001c..24d2bbde 100644 --- a/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj +++ b/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj @@ -461,6 +461,9 @@ Bz53203.xaml + + TestXmlnsUsing.xaml + Bz54334.xaml @@ -848,6 +851,9 @@ MSBuild:UpdateDesignTimeXaml + + MSBuild:UpdateDesignTimeXaml + MSBuild:UpdateDesignTimeXaml -- cgit v1.2.3