summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests/Issues/Bz28556.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/Issues/Bz28556.xaml.cs')
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz28556.xaml.cs58
1 files changed, 58 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz28556.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz28556.xaml.cs
new file mode 100644
index 00000000..dd5bb317
--- /dev/null
+++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz28556.xaml.cs
@@ -0,0 +1,58 @@
+´╗┐using System;
+using System.Collections.Generic;
+
+using Xamarin.Forms;
+
+using NUnit.Framework;
+
+namespace Xamarin.Forms.Xaml.UnitTests
+{
+ public partial class Bz28556 : ContentPage
+ {
+ public Bz28556 ()
+ {
+ InitializeComponent ();
+ }
+
+ public Bz28556 (bool useCompiledXaml)
+ {
+ //this stub will be replaced at compile time
+ }
+
+ [TestFixture]
+ class Tests
+ {
+ [TestCase(true)]
+ [TestCase(false)]
+ public void SettersAppliedBeforeTriggers (bool useCompiledXaml)
+ {
+ var layout = new Bz28556 (useCompiledXaml);
+
+ Assert.AreEqual (Color.Yellow, layout.entry.TextColor);
+ Assert.AreEqual (Color.Green, layout.entry.BackgroundColor);
+
+ Assert.AreEqual (Color.Red, layout.disableEntry.TextColor);
+ Assert.AreEqual (Color.Purple, layout.disableEntry.BackgroundColor);
+
+ layout.entry.IsEnabled = false;
+ layout.disableEntry.IsEnabled = true;
+
+ Assert.AreEqual (Color.Yellow, layout.disableEntry.TextColor);
+ Assert.AreEqual (Color.Green, layout.disableEntry.BackgroundColor);
+
+ Assert.AreEqual (Color.Red, layout.entry.TextColor);
+ Assert.AreEqual (Color.Purple, layout.entry.BackgroundColor);
+
+ layout.entry.IsEnabled = true;
+ layout.disableEntry.IsEnabled = false;
+
+ Assert.AreEqual (Color.Yellow, layout.entry.TextColor);
+ Assert.AreEqual (Color.Green, layout.entry.BackgroundColor);
+
+ Assert.AreEqual (Color.Red, layout.disableEntry.TextColor);
+ Assert.AreEqual (Color.Purple, layout.disableEntry.BackgroundColor);
+ }
+ }
+ }
+}
+