Пример #1
0
        public void ProvideValue_returns_instance()
        {
            var converter     = new AnyBoolToBoolConverter();
            var providedValue = converter.ProvideValue(null);

            Assert.IsType <AnyBoolToBoolConverter>(providedValue);
        }
Пример #2
0
        public void ConvertBack_throws_NotSupportedException()
        {
            var converter = new AnyBoolToBoolConverter();
            var culture   = new CultureInfo("en-US");

            Assert.Throws <NotSupportedException>(() => converter.ConvertBack(true, new[] { typeof(bool) }, null, culture));
        }
Пример #3
0
        public void Convert(object[] input, Type targetType, object parameter, string cultureString, object expectedOutput)
        {
            var converter = new AnyBoolToBoolConverter();
            var culture   = new CultureInfo(cultureString);
            var output    = converter.Convert(input, targetType, parameter, culture);

            Assert.Equal(expectedOutput, output);
        }
Пример #4
0
        public void Convert_returns_DependencyPropertyUnsetValue_when_values_null()
        {
            var converter = new AnyBoolToBoolConverter();
            var culture   = new CultureInfo("en-US");

#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
            var output = converter.Convert(null, typeof(bool), null, culture);
#pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type.
            Assert.Equal(DependencyProperty.UnsetValue, output);
        }