Ejemplo n.º 1
0
        public void InvertsOtherConverter()
        {
            IValueConverter normalConverter    = new IntToStringConverter();
            var             invertingConverter = new InvertingConverter(normalConverter);

            const int    convertValue     = 123;
            const string convertBackValue = "123";

            Assert.Equal(
                normalConverter.Convert(convertValue, typeof(string), null, null),
                invertingConverter.ConvertBack(convertValue, typeof(string), null, null));
            Assert.Equal(
                normalConverter.ConvertBack(convertBackValue, typeof(string), null, null),
                invertingConverter.Convert(convertBackValue, typeof(string), null, null));
        }
Ejemplo n.º 2
0
        public void Convert_Conversion_AreEqual(int number, string properOutput)
        {
            string converted = (string)intToStringConverter.Convert(number, typeof(string), null, System.Globalization.CultureInfo.InvariantCulture);

            Assert.AreEqual(properOutput, converted);
        }