diff options
author | Stephane Delcroix <stephane@delcroix.org> | 2016-12-01 22:34:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-01 22:34:39 +0100 |
commit | e413e0cf331ae1512e2d8a6fcc89446c1cf2225c (patch) | |
tree | 5aad168ffd3e0679bb36b4a54f5465e501629411 /Xamarin.Forms.Xaml.UnitTests/XStatic.xaml.cs | |
parent | 00b652cd43902b4499706d1f9172041c20083ae8 (diff) | |
download | xamarin-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.cs | 24 |
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 |