From b85bf5a87ec3ea5cf5e459468328458aa9b072f2 Mon Sep 17 00:00:00 2001 From: JohanLarsson Date: Thu, 19 Jul 2018 14:10:30 +0200 Subject: [PATCH] Move explicit tests to issue #200. --- .../CodeFix.cs | 48 ------------------- .../CodeFix.cs | 48 ------------------- 2 files changed, 96 deletions(-) diff --git a/WpfAnalyzers.Test/WPF0020CastValueToCorrectTypeTests/CodeFix.cs b/WpfAnalyzers.Test/WPF0020CastValueToCorrectTypeTests/CodeFix.cs index 874bd489..b2bd48eb 100644 --- a/WpfAnalyzers.Test/WPF0020CastValueToCorrectTypeTests/CodeFix.cs +++ b/WpfAnalyzers.Test/WPF0020CastValueToCorrectTypeTests/CodeFix.cs @@ -693,54 +693,6 @@ private static void OnBackgroundChanged(DependencyObject d, DependencyPropertyCh 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 source property.")] - [Test] - public void DependencyPropertyAddOwner() - { - var testCode = @" -namespace RoslynSandbox -{ - using System.Windows; - using System.Windows.Controls; - using System.Windows.Documents; - - public class FooControl : FrameworkElement - { - static FooControl() - { - TextElement.FontSizeProperty.AddOwner(typeof(FooControl), new PropertyMetadata(12.0, 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; - using System.Windows.Documents; - - public class FooControl : FrameworkElement - { - static FooControl() - { - TextElement.FontSizeProperty.AddOwner(typeof(FooControl), new PropertyMetadata(12.0, OnFontSizeChanged)); - } - - private static void OnFontSizeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - // nop - } - } }"; AnalyzerAssert.CodeFix(Analyzer, Fix, ExpectedDiagnostic, testCode, fixedCode); } diff --git a/WpfAnalyzers.Test/WPF0022DirectCastValueToExactTypeTests/CodeFix.cs b/WpfAnalyzers.Test/WPF0022DirectCastValueToExactTypeTests/CodeFix.cs index 549f674b..9e563359 100644 --- a/WpfAnalyzers.Test/WPF0022DirectCastValueToExactTypeTests/CodeFix.cs +++ b/WpfAnalyzers.Test/WPF0022DirectCastValueToExactTypeTests/CodeFix.cs @@ -546,54 +546,6 @@ private static void OnBackgroundChanged(DependencyObject d, DependencyPropertyCh var value = (↓System.Collections.IEnumerable)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 source property.")] - [Test] - public void DependencyPropertyAddOwner() - { - var testCode = @" -namespace RoslynSandbox -{ - using System.Windows; - using System.Windows.Controls; - using System.Windows.Documents; - - public class FooControl : FrameworkElement - { - static FooControl() - { - TextElement.FontSizeProperty.AddOwner(typeof(FooControl), new PropertyMetadata(12.0, 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; - using System.Windows.Documents; - - public class FooControl : FrameworkElement - { - static FooControl() - { - TextElement.FontSizeProperty.AddOwner(typeof(FooControl), new PropertyMetadata(12.0, OnFontSizeChanged)); - } - - private static void OnFontSizeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - // nop - } - } }"; AnalyzerAssert.CodeFix(Analyzer, Fix, ExpectedDiagnostic, testCode, fixedCode); }