public void Convert_WithConverterParameter_UsesVersionFormatter(string converterParameter) { var value = new NuGetVersion("1.0.0+metadata"); var converter = new VersionToStringConverter(); var converted = converter.Convert( value, typeof(string), converterParameter, Thread.CurrentThread.CurrentCulture); Assert.Equal(value.ToString(converterParameter, VersionFormatter.Instance), converted); }
public void Convert_WithoutConverterParameter_DefaultsToNormalizedVersionString() { var value = new NuGetVersion("1.0.0.0"); var converter = new VersionToStringConverter(); var converted = converter.Convert( value, typeof(string), null, Thread.CurrentThread.CurrentCulture); Assert.Equal(value.ToNormalizedString(), converted); }