public void ToDoubleTest(object value, bool expected) { var actual = DoubleHelper.ToDouble(value); var isDefaultResult = actual.EqualsWithinTolerance(default(double), 6); if (!isDefaultResult) { actual = DoubleHelper.ToDouble(value); isDefaultResult = actual.EqualsWithinTolerance(default(double), 6); } Assert.Equal(expected, isDefaultResult); }
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) // From string to double { return((value != null) ? DoubleHelper.ToDouble(value.ToString()) : null); }