示例#1
0
        public void ShouldSetValueToSourceAdapterWhenSettingValue()
        {
            var converter     = new NullValueConverter();
            var sourceAdapter = new ValueAdapter();
            var adapter       = new ConvertingAdapter(sourceAdapter, converter);

            adapter.SetValue(5);

            Assert.AreEqual(5, sourceAdapter.Value);
        }
示例#2
0
        public void ShouldSetConvertedValueWhenSettingValue()
        {
            var converter = new ValueConverter {
                ReturnedTarget = 5
            };
            var sourceAdapter = new ValueAdapter();
            var adapter       = new ConvertingAdapter(sourceAdapter, converter);

            adapter.SetValue(null);

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