diff options
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/TriggerTests.xaml.cs')
-rw-r--r-- | Xamarin.Forms.Xaml.UnitTests/TriggerTests.xaml.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/TriggerTests.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/TriggerTests.xaml.cs new file mode 100644 index 00000000..5fe61bee --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/TriggerTests.xaml.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using Xamarin.Forms; +using NUnit.Framework; + +namespace Xamarin.Forms.Xaml.UnitTests +{ + public partial class TriggerTests : ContentPage + { + public TriggerTests () + { + InitializeComponent (); + } + + public TriggerTests (bool useCompiledXaml) + { + //this stub will be replaced at compile time + } + + [TestFixture] + public class Tests + { + [TestCase (false)] + [TestCase (true)] + public void ValueIsConverted (bool useCompiledXaml) + { + var layout = new TriggerTests (useCompiledXaml); + Entry entry = layout.entry; + Assert.NotNull (entry); + + var triggers = entry.Triggers; + Assert.IsNotEmpty (triggers); + var pwTrigger = triggers [0] as Trigger; + Assert.AreEqual (Entry.IsPasswordProperty, pwTrigger.Property); + Assert.AreEqual (true, pwTrigger.Value); + } + } + } +}
\ No newline at end of file |