diff options
author | Stephane Delcroix <stephane@delcroix.org> | 2016-08-02 22:24:50 +0200 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-08-02 13:24:50 -0700 |
commit | 89199205e48fe3fdf4336fe7e0f8af7dc0b662de (patch) | |
tree | 42e4d3a8f53ecd45d95b290bcdedd809eb046e4c /Xamarin.Forms.Xaml.UnitTests/FindByName.xaml.cs | |
parent | ac44cf9dec53b3b8be1836f20479f01820f3667f (diff) | |
download | xamarin-forms-89199205e48fe3fdf4336fe7e0f8af7dc0b662de.tar.gz xamarin-forms-89199205e48fe3fdf4336fe7e0f8af7dc0b662de.tar.bz2 xamarin-forms-89199205e48fe3fdf4336fe7e0f8af7dc0b662de.zip |
Xaml convert on add (#273)
* [Xaml] add test for conversion on Set and Add
* [Xaml] Fix conversion on Add()
* [XamlC] use op_implicit before Add()
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/FindByName.xaml.cs')
-rw-r--r-- | Xamarin.Forms.Xaml.UnitTests/FindByName.xaml.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/FindByName.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/FindByName.xaml.cs new file mode 100644 index 00000000..c80ca6a6 --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/FindByName.xaml.cs @@ -0,0 +1,40 @@ +using NUnit.Framework; + +using Xamarin.Forms; + +namespace Xamarin.Forms.Xaml.UnitTests +{ + public partial class FindByName : ContentPage + { + public FindByName () + { + InitializeComponent (); + } + + public FindByName (bool useCompiledXaml) + { + //this stub will be replaced at compile time + } + + [TestFixture] + public class FindByNameTests + { + [TestCase (false)] + [TestCase (true)] + public void TestRootName (bool useCompiledXaml) + { + var page = new FindByName (useCompiledXaml); + Assert.AreSame (page, ((Forms.Internals.INameScope)page).FindByName ("root")); + Assert.AreSame (page, page.FindByName<FindByName> ("root")); + } + + [TestCase (false)] + [TestCase (true)] + public void TestName (bool useCompiledXaml) + { + var page = new FindByName (useCompiledXaml); + Assert.AreSame (page.label0, page.FindByName<Label> ("label0")); + } + } + } +}
\ No newline at end of file |