summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests/Issues
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2016-07-21 20:59:40 +0200
committerJason Smith <jason.smith@xamarin.com>2016-07-21 11:59:40 -0700
commit2590d913f7c69f1be60c2c5ac7fb60d0ec8732ed (patch)
tree981c141f8503ecf27531bc94ace0a64dad6e344d /Xamarin.Forms.Xaml.UnitTests/Issues
parenta80d5c0de704837588138966be1b38a89ed24be9 (diff)
downloadxamarin-forms-2590d913f7c69f1be60c2c5ac7fb60d0ec8732ed.tar.gz
xamarin-forms-2590d913f7c69f1be60c2c5ac7fb60d0ec8732ed.tar.bz2
xamarin-forms-2590d913f7c69f1be60c2c5ac7fb60d0ec8732ed.zip
[XamlC] Fix the getter of getters (#263)
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/Issues')
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Unreported004.xaml7
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Unreported004.xaml.cs53
2 files changed, 60 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Unreported004.xaml b/Xamarin.Forms.Xaml.UnitTests/Issues/Unreported004.xaml
new file mode 100644
index 00000000..7ed94589
--- /dev/null
+++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Unreported004.xaml
@@ -0,0 +1,7 @@
+<?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.Unreported004">
+ <Label x:Name="label" local:Unreported004.SomeProperty="foo" />
+</ContentPage>
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Unreported004.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Unreported004.xaml.cs
new file mode 100644
index 00000000..ff2dac08
--- /dev/null
+++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Unreported004.xaml.cs
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using NUnit.Framework;
+using Xamarin.Forms;
+
+namespace Xamarin.Forms.Xaml.UnitTests
+{
+ public partial class Unreported004 : ContentPage
+ {
+ public Unreported004()
+ {
+ InitializeComponent();
+ }
+
+ public Unreported004(bool useCompiledXaml)
+ {
+ //this stub will be replaced at compile time
+ }
+
+ public static readonly BindableProperty SomePropertyProperty =
+ BindableProperty.Create("SomeProperty", typeof(string),
+ typeof(Unreported004), null);
+
+ public static string GetSomeProperty(BindableObject bindable)
+ {
+ return bindable.GetValue(SomePropertyProperty) as string;
+ }
+
+ public static string GetSomeProperty(BindableObject bindable, object foo)
+ {
+ return null;
+ }
+
+ public static void SetSomeProperty(BindableObject bindable, string value)
+ {
+ bindable.SetValue(SomePropertyProperty, value);
+ }
+
+
+ [TestFixture]
+ class Tests
+ {
+ [TestCase(true), TestCase(false)]
+ public void MultipleGetMethodsAllowed(bool useCompiledXaml)
+ {
+ var page = new Unreported004();
+ Assert.NotNull(page.label);
+ Assert.AreEqual("foo", GetSomeProperty(page.label));
+ }
+ }
+ }
+}
+