[test] passing test for 53318 (#818)
authorStephane Delcroix <stephane@delcroix.org>
Wed, 15 Mar 2017 10:35:44 +0000 (11:35 +0100)
committerGitHub <noreply@github.com>
Wed, 15 Mar 2017 10:35:44 +0000 (11:35 +0100)
Xamarin.Forms.Xaml.UnitTests/Issues/Bz53318.xaml [new file with mode: 0644]
Xamarin.Forms.Xaml.UnitTests/Issues/Bz53318.xaml.cs [new file with mode: 0644]
Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj

diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz53318.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz53318.xaml
new file mode 100644 (file)
index 0000000..51e2b77
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
+       xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+       xmlns:local="clr-namespace:Xamarin.Forms.Xaml.UnitTests"
+       x:Class="Xamarin.Forms.Xaml.UnitTests.Bz53318">
+       <ListView>
+               <ListView.ItemTemplate>
+                       <DataTemplate>
+                               <local:Bz53318ListView>
+                    <x:Arguments>
+                        <ListViewCachingStrategy>RecycleElement</ListViewCachingStrategy>
+                    </x:Arguments>
+                </local:Bz53318ListView>
+                       </DataTemplate>
+               </ListView.ItemTemplate>
+       </ListView>
+</ContentPage>
\ No newline at end of file
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz53318.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz53318.xaml.cs
new file mode 100644 (file)
index 0000000..e04eee1
--- /dev/null
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using NUnit.Framework;
+using Xamarin.Forms;
+using Xamarin.Forms.Core.UnitTests;
+using Xamarin.Forms.Xaml;
+
+namespace Xamarin.Forms.Xaml.UnitTests
+{
+       public class Bz53318ListView : ListView
+       {
+       }
+
+       [XamlCompilation(XamlCompilationOptions.Skip)]
+       public partial class Bz53318 : ContentPage
+       {
+               public Bz53318()
+               {
+                       InitializeComponent();
+               }
+
+               [TestFixture]
+               public class Tests
+               {
+                       [SetUp]
+                       public void Setup()
+                       {
+                               Device.PlatformServices = new MockPlatformServices();
+                       }
+
+                       [TearDown]
+                       public void TearDown()
+                       {
+                               Device.PlatformServices = null;
+                       }
+
+                       [Test]
+                       public void DoesCompilesArgsInsideDataTemplate()
+                       {
+                               Assert.DoesNotThrow(()=>MockCompiler.Compile(typeof(Bz53318)));
+                       }
+               }
+       }
+}
\ No newline at end of file
index 0f0f2c5..8cdd821 100644 (file)
     <Compile Include="Issues\Unreported009.xaml.cs">
       <DependentUpon>Unreported009.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Issues\Bz53318.xaml.cs">
+      <DependentUpon>Bz53318.xaml</DependentUpon>
+    </Compile>
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <Import Project="..\.nuspec\Xamarin.Forms.Debug.targets" />
     <EmbeddedResource Include="Issues\Unreported009.xaml">
       <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
     </EmbeddedResource>
+    <EmbeddedResource Include="Issues\Bz53318.xaml">
+      <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+    </EmbeddedResource>
   </ItemGroup>
   <ItemGroup>
     <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />