summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2017-01-18 13:04:13 +0100
committerGitHub <noreply@github.com>2017-01-18 13:04:13 +0100
commit3701720f0d69ec834634f95e6f464dc900eeb855 (patch)
treeccc925e20b4e6095af11473bba6f27295a2fa1e9 /Xamarin.Forms.Xaml.UnitTests
parent5fec30f288fffd6ad7c11a0557c809f3befdd79a (diff)
downloadxamarin-forms-3701720f0d69ec834634f95e6f464dc900eeb855.tar.gz
xamarin-forms-3701720f0d69ec834634f95e6f464dc900eeb855.tar.bz2
xamarin-forms-3701720f0d69ec834634f95e6f464dc900eeb855.zip
[XamlC] compile ListStringTypeConverter (#660)
* [XamlC] compile ListStringTypeConverter * remove debug statements
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests')
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml3
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml.cs9
2 files changed, 10 insertions, 2 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml b/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml
index 296f9eeb..7118c5d8 100644
--- a/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml
+++ b/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml
@@ -4,7 +4,8 @@
x:Class="Xamarin.Forms.Xaml.UnitTests.CompiledTypeConverter"
RectangleP="0,1,2,4"
RectangleBP="4,8,16,32"
- BackgroundColor="Pink">
+ BackgroundColor="Pink"
+ List="Foo, Bar">
<Label x:Name="label"
HorizontalOptions="EndAndExpand"
RelativeLayout.XConstraint="2" Margin="2,3"/>
diff --git a/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml.cs
index 1ef319a3..f74b5a73 100644
--- a/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml.cs
+++ b/Xamarin.Forms.Xaml.UnitTests/CompiledTypeConverter.xaml.cs
@@ -1,4 +1,5 @@
-using NUnit.Framework;
+using System.Collections.Generic;
+using NUnit.Framework;
namespace Xamarin.Forms.Xaml.UnitTests
{
@@ -14,6 +15,10 @@ namespace Xamarin.Forms.Xaml.UnitTests
public Rectangle RectangleP { get; set; }
+ [TypeConverter(typeof(ListStringTypeConverter))]
+ public IList<string> List { get; set; }
+
+
public CompiledTypeConverter ()
{
InitializeComponent ();
@@ -39,6 +44,8 @@ namespace Xamarin.Forms.Xaml.UnitTests
var xConstraint = RelativeLayout.GetXConstraint(p.label);
Assert.AreEqual(2, xConstraint.Compute(null));
Assert.AreEqual(new Thickness(2, 3), p.label.Margin);
+ Assert.AreEqual(2, p.List.Count);
+ Assert.AreEqual("Bar", p.List[1]);
}
}
}