【发布时间】:2018-10-31 00:28:29
【问题描述】:
我在我的项目中定义了一个转换器。我想从为该转换器编写单元测试用例开始。
转换器的代码是:
public class BirdEyeViewColumnWidthConverter : IValueConverter
{
public int BirdEyeModeWidth { get; set; }
public int DefaultWidth { get; set; }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value != null)
{
if ((bool) value)
{
return BirdEyeModeWidth;
}
}
return DefaultWidth;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
我该如何开始呢?
【问题讨论】:
标签: c# wpf xaml converters