public void ConvertTest(object value)
        {
            var converterGroup = new ValueConverterGroup();

            converterGroup.Add(new MockConverter());
            converterGroup.Add(new MockConverter());
            converterGroup.Add(new MockConverter());

            var result = converterGroup.Convert(value, typeof(string), null, CultureInfo.CurrentCulture);

            var correctValue = $"{MockConverter.Tag}{MockConverter.Tag}{MockConverter.Tag}{value.ToString()}";

            Assert.AreEqual(correctValue, result);
        }
Exemplo n.º 2
0
        public void TautologyTest(bool?input)
        {
            // Arrange
            var group = new ValueConverterGroup();

            group.Converters.Add(new InverseBooleanConverter());
            group.Converters.Add(new InverseBooleanConverter());

            // Act
            var result     = group.Convert(input, typeof(bool), null, CultureInfo.CurrentCulture);
            var resultBack = group.ConvertBack(result, typeof(bool), null, CultureInfo.CurrentCulture);

            // Assert
            Assert.AreEqual(input, result);
            Assert.AreEqual(input, resultBack);
        }
 public void Setup()
 {
     converter = new ValueConverterGroup();
 }