@@ -161,6 +161,45 @@ object IValueConverter.ConvertBack(object value, System.Type targetType, object
161161 RoslynAssert . CodeFix ( Fix , ExpectedDiagnostic , before , after ) ;
162162 }
163163
164+ [ Test ]
165+ public static void IMultiValueConverterConvert ( )
166+ {
167+ var before = @"
168+ namespace N
169+ {
170+ using System.Windows.Data;
171+
172+ public class C : ↓IMultiValueConverter
173+ {
174+ object[] IMultiValueConverter.ConvertBack(object value, System.Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
175+ {
176+ throw new System.NotSupportedException($""{nameof(C)} can only be used in OneWay bindings"");
177+ }
178+ }
179+ }" ;
180+
181+ var after = @"
182+ namespace N
183+ {
184+ using System.Windows.Data;
185+
186+ public class C : IMultiValueConverter
187+ {
188+ object[] IMultiValueConverter.ConvertBack(object value, System.Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
189+ {
190+ throw new System.NotSupportedException($""{nameof(C)} can only be used in OneWay bindings"");
191+ }
192+
193+ public object Convert(object[] values, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
194+ {
195+ throw new System.NotImplementedException();
196+ }
197+ }
198+ }" ;
199+
200+ RoslynAssert . CodeFix ( Fix , ExpectedDiagnostic , before , after ) ;
201+ }
202+
164203 [ Test ]
165204 public static void IMultiValueConverterConvertBack ( )
166205 {
@@ -199,4 +238,43 @@ object[] IMultiValueConverter.ConvertBack(object value, System.Type[] targetType
199238
200239 RoslynAssert . CodeFix ( Fix , ExpectedDiagnostic , before , after ) ;
201240 }
241+
242+ [ Test ]
243+ public static void IMultiValueConverterConvertBackFileScopedNamespace ( )
244+ {
245+ var before = @"
246+ namespace N;
247+
248+ using System.Windows.Data;
249+
250+ public class C : ↓IMultiValueConverter
251+ {
252+ public object Convert(object[] values, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
253+ {
254+ throw new System.NotImplementedException();
255+ }
256+ }
257+ " ;
258+
259+ var after = @"
260+ namespace N;
261+
262+ using System.Windows.Data;
263+
264+ public class C : IMultiValueConverter
265+ {
266+ public object Convert(object[] values, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
267+ {
268+ throw new System.NotImplementedException();
269+ }
270+
271+ object[] IMultiValueConverter.ConvertBack(object value, System.Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
272+ {
273+ throw new System.NotSupportedException($""{nameof(C)} can only be used in OneWay bindings"");
274+ }
275+ }
276+ " ;
277+
278+ RoslynAssert . CodeFix ( Fix , ExpectedDiagnostic , before , after ) ;
279+ }
202280}
0 commit comments