public void PropertyChangedTrigger_SetBindingValue_ValueChangedTwice()
        {
            StubDataStore          dataStore  = this.CreateDataStore();
            PropertyChangedTrigger trigger    = CreateTrigger <PropertyChangedTrigger>(dataStore, "Foo");
            StubAction             stubAction = CreateStubAction();

            trigger.Actions.Add(stubAction);

            this.Test_SetBindingValue_ValueChangedTwice(trigger, stubAction, dataStore);
        }
        public void DataStoreChangeTrigger_SetBindingValue_ValueChangedWithSameValue()
        {
            StubDataStore           dataStore = this.CreateDataStore();
            DataStoreChangedTrigger trigger   = CreateTrigger <DataStoreChangedTrigger>(dataStore, "Foo");
            StubAction stubAction             = CreateStubAction();

            trigger.Actions.Add(stubAction);

            this.Test_SetBindingValue_ValueChangedWithSameValue(trigger, stubAction, dataStore);
        }
 private void Test_SetBindingValue_ValueChanged(TriggerBase <DependencyObject> trigger, StubAction stubAction, StubDataStore dataStore)
 {
     using (StubWindow window = new StubWindow(null))
     {
         // Change the value on the data store.
         dataStore.Foo = "foo";
         // Force the Data binding phase
         DispatcherHelper.ForceDataBinding();
         Assert.AreEqual(stubAction.InvokeCount, 1, "The trigger should have been invoked once.");
     }
 }