diff options
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 |