コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 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.");
     }
 }