예제 #1
0
        public void UpdateTargetShouldNotPassNoValueFromSourceToTarget()
        {
            var sourceAdapter = new ValueAdapter();
            var targetAdapter = new ValueAdapter();
            var binding       = new ValueBinding(targetAdapter, sourceAdapter);

            sourceAdapter.Value = SettingsConstants.NoValue;

            binding.UpdateTarget();

            Assert.IsFalse(targetAdapter.SetValueCalled);
        }
예제 #2
0
        public void UpdateTargetShouldPassValueFromSourceToTarget()
        {
            var sourceAdapter = new ValueAdapter();
            var targetAdapter = new ValueAdapter();
            var binding       = new ValueBinding(targetAdapter, sourceAdapter);

            sourceAdapter.Value = 5;

            binding.UpdateTarget();

            Assert.AreEqual(5, sourceAdapter.Value);
        }