summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests/XStatic.xaml.cs
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2016-12-01 22:34:39 +0100
committerGitHub <noreply@github.com>2016-12-01 22:34:39 +0100
commite413e0cf331ae1512e2d8a6fcc89446c1cf2225c (patch)
tree5aad168ffd3e0679bb36b4a54f5465e501629411 /Xamarin.Forms.Xaml.UnitTests/XStatic.xaml.cs
parent00b652cd43902b4499706d1f9172041c20083ae8 (diff)
downloadxamarin-forms-e413e0cf331ae1512e2d8a6fcc89446c1cf2225c.tar.gz
xamarin-forms-e413e0cf331ae1512e2d8a6fcc89446c1cf2225c.tar.bz2
xamarin-forms-e413e0cf331ae1512e2d8a6fcc89446c1cf2225c.zip
[XamlC] use op_implicit where we should (#580)
* [XamlC] (passing) test for 48242 * [XamlC] (failing) test for 48242 * [XamlC] more op_implicit conversions * additional test * fix rebase
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/XStatic.xaml.cs')
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/XStatic.xaml.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/XStatic.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/XStatic.xaml.cs
index d8a466e9..19c62630 100644
--- a/Xamarin.Forms.Xaml.UnitTests/XStatic.xaml.cs
+++ b/Xamarin.Forms.Xaml.UnitTests/XStatic.xaml.cs
@@ -3,11 +3,18 @@ using Xamarin.Forms.Core.UnitTests;
namespace Xamarin.Forms.Xaml.UnitTests
{
+
+ public class Icons
+ {
+ public const string CLOSE = "ic_close.png";
+ }
+
public class MockxStatic
{
public static string MockStaticProperty { get { return "Property"; } }
public const string MockConstant = "Constant";
public static string MockField = "Field";
+ public static string MockFieldRef = Icons.CLOSE;
public string InstanceProperty { get { return "InstanceProperty"; } }
public static readonly Color BackgroundColor = Color.Fuchsia;
}
@@ -102,6 +109,23 @@ namespace Xamarin.Forms.Xaml.UnitTests
var layout = new XStatic(useCompiledXaml);
Assert.AreEqual(ScrollOrientation.Both, layout.enuM.Orientation);
}
+
+ [TestCase(false)]
+ [TestCase(true)]
+ public void FieldRef(bool useCompiledXaml)
+ {
+ var layout = new XStatic(useCompiledXaml);
+ Assert.AreEqual("ic_close.png", layout.field2.Text);
+ }
+
+ [TestCase(false)]
+ [TestCase(true)]
+ // https://bugzilla.xamarin.com/show_bug.cgi?id=48242
+ public void xStaticAndImplicitOperators(bool useCompiledXaml)
+ {
+ var layout = new XStatic(useCompiledXaml);
+ Assert.AreEqual("ic_close.png", layout.ToolbarItems[0].Icon.File);
+ }
}
}
} \ No newline at end of file