summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2017-01-18 13:04:13 +0100
committerKangho Hur <kangho.hur@samsung.com>2017-03-24 13:12:23 +0900
commita003d578219a9c8832bdc6589dda4051ddfa9c3b (patch)
treef8e561568c8d8d2b567fc9b607a7c1602abffa32 /Xamarin.Forms.Xaml.UnitTests
parent69561c121c55645fb05ace1f67b7636a5f2a2ec2 (diff)
downloadxamarin-forms-a003d578219a9c8832bdc6589dda4051ddfa9c3b.tar.gz
xamarin-forms-a003d578219a9c8832bdc6589dda4051ddfa9c3b.tar.bz2
xamarin-forms-a003d578219a9c8832bdc6589dda4051ddfa9c3b.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]);
}
}
}