diff --git a/WpfAnalyzers.Test/WPF0020CastValueToCorrectTypeTests/CodeFix.cs b/WpfAnalyzers.Test/WPF0020CastValueToCorrectTypeTests/CodeFix.cs index b2bd48eb..9cbab9f2 100644 --- a/WpfAnalyzers.Test/WPF0020CastValueToCorrectTypeTests/CodeFix.cs +++ b/WpfAnalyzers.Test/WPF0020CastValueToCorrectTypeTests/CodeFix.cs @@ -645,54 +645,6 @@ private static void OnValueChanged(DependencyObject d, DependencyPropertyChanged var value = (int)e.NewValue; } } -}"; - AnalyzerAssert.CodeFix(Analyzer, Fix, ExpectedDiagnostic, testCode, fixedCode); - } - - [Explicit("Not handling this yet, will be a bit messy as we need to get the type from the overridden property.")] - [Test] - public void DependencyPropertyOverrideMetadata() - { - var testCode = @" -namespace RoslynSandbox -{ - using System.Windows; - using System.Windows.Controls; - - public class FooControl : UserControl - { - static FooControl() - { - BackgroundProperty.OverrideMetadata(typeof(FooControl), - new FrameworkPropertyMetadata(null, OnValueChanged)); - } - - private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var value = (↓string)e.NewValue; - } - } -}"; - - var fixedCode = @" -namespace RoslynSandbox -{ - using System.Windows; - using System.Windows.Controls; - - public class FooControl : UserControl - { - static FooControl() - { - BackgroundProperty.OverrideMetadata(typeof(FooControl), - new FrameworkPropertyMetadata(null, OnBackgroundChanged)); - } - - private static void OnBackgroundChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var value = (↓string)e.NewValue; - } - } }"; AnalyzerAssert.CodeFix(Analyzer, Fix, ExpectedDiagnostic, testCode, fixedCode); } diff --git a/WpfAnalyzers.Test/WPF0022DirectCastValueToExactTypeTests/CodeFix.cs b/WpfAnalyzers.Test/WPF0022DirectCastValueToExactTypeTests/CodeFix.cs index 9e563359..21633c08 100644 --- a/WpfAnalyzers.Test/WPF0022DirectCastValueToExactTypeTests/CodeFix.cs +++ b/WpfAnalyzers.Test/WPF0022DirectCastValueToExactTypeTests/CodeFix.cs @@ -498,54 +498,6 @@ private static void OnValueChanged(DependencyObject d, DependencyPropertyChanged var value = (string)e.NewValue; } } -}"; - AnalyzerAssert.CodeFix(Analyzer, Fix, ExpectedDiagnostic, testCode, fixedCode); - } - - [Explicit("Not handling this yet, will be a bit messy as we need to get the type from the overridden property.")] - [Test] - public void DependencyPropertyOverrideMetadata() - { - var testCode = @" -namespace RoslynSandbox -{ - using System.Windows; - using System.Windows.Controls; - - public class FooControl : UserControl - { - static FooControl() - { - BackgroundProperty.OverrideMetadata(typeof(FooControl), - new FrameworkPropertyMetadata(null, OnValueChanged)); - } - - private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var value = (↓int)e.NewValue; - } - } -}"; - - var fixedCode = @" -namespace RoslynSandbox -{ - using System.Windows; - using System.Windows.Controls; - - public class FooControl : UserControl - { - static FooControl() - { - BackgroundProperty.OverrideMetadata(typeof(FooControl), - new FrameworkPropertyMetadata(null, OnBackgroundChanged)); - } - - private static void OnBackgroundChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var value = (↓System.Collections.IEnumerable)e.NewValue; - } - } }"; AnalyzerAssert.CodeFix(Analyzer, Fix, ExpectedDiagnostic, testCode, fixedCode); }