From 98a5233c2fdf181f18a8d02da9f2f37635b85889 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 11 Dec 2022 23:57:48 +0100 Subject: [PATCH] Suppress warnings from analyzers in unit tests --- .../ModelWithObservableObjectAttribute.cs | 2 ++ .../SampleModelWithINPCAndObservableProperties.cs | 2 ++ .../Test_INotifyPropertyChangedAttribute.cs | 2 ++ .../Test_ObservableObjectAttribute.cs | 2 ++ .../Test_ObservablePropertyAttribute.cs | 4 ++++ .../Test_ObservableRecipientAttribute.cs | 2 ++ .../CommunityToolkit.Mvvm.UnitTests/Test_SourceGenerators.cs | 2 ++ 7 files changed, 16 insertions(+) diff --git a/tests/CommunityToolkit.Mvvm.ExternalAssembly/ModelWithObservableObjectAttribute.cs b/tests/CommunityToolkit.Mvvm.ExternalAssembly/ModelWithObservableObjectAttribute.cs index 93adb5da1..e42550605 100644 --- a/tests/CommunityToolkit.Mvvm.ExternalAssembly/ModelWithObservableObjectAttribute.cs +++ b/tests/CommunityToolkit.Mvvm.ExternalAssembly/ModelWithObservableObjectAttribute.cs @@ -4,6 +4,8 @@ using CommunityToolkit.Mvvm.ComponentModel; +#pragma warning disable MVVMTK0033 + namespace CommunityToolkit.Mvvm.ExternalAssembly; /// diff --git a/tests/CommunityToolkit.Mvvm.ExternalAssembly/SampleModelWithINPCAndObservableProperties.cs b/tests/CommunityToolkit.Mvvm.ExternalAssembly/SampleModelWithINPCAndObservableProperties.cs index 69a8e5dae..1066a2350 100644 --- a/tests/CommunityToolkit.Mvvm.ExternalAssembly/SampleModelWithINPCAndObservableProperties.cs +++ b/tests/CommunityToolkit.Mvvm.ExternalAssembly/SampleModelWithINPCAndObservableProperties.cs @@ -4,6 +4,8 @@ using CommunityToolkit.Mvvm.ComponentModel; +#pragma warning disable MVVMTK0032 + namespace CommunityToolkit.Mvvm.ExternalAssembly; /// diff --git a/tests/CommunityToolkit.Mvvm.UnitTests/Test_INotifyPropertyChangedAttribute.cs b/tests/CommunityToolkit.Mvvm.UnitTests/Test_INotifyPropertyChangedAttribute.cs index e63a71057..095a9fcb0 100644 --- a/tests/CommunityToolkit.Mvvm.UnitTests/Test_INotifyPropertyChangedAttribute.cs +++ b/tests/CommunityToolkit.Mvvm.UnitTests/Test_INotifyPropertyChangedAttribute.cs @@ -8,6 +8,8 @@ using CommunityToolkit.Mvvm.ComponentModel; using Microsoft.VisualStudio.TestTools.UnitTesting; +#pragma warning disable MVVMTK0032 + namespace CommunityToolkit.Mvvm.UnitTests; [TestClass] diff --git a/tests/CommunityToolkit.Mvvm.UnitTests/Test_ObservableObjectAttribute.cs b/tests/CommunityToolkit.Mvvm.UnitTests/Test_ObservableObjectAttribute.cs index 750cd93d8..78ed9320d 100644 --- a/tests/CommunityToolkit.Mvvm.UnitTests/Test_ObservableObjectAttribute.cs +++ b/tests/CommunityToolkit.Mvvm.UnitTests/Test_ObservableObjectAttribute.cs @@ -6,6 +6,8 @@ using CommunityToolkit.Mvvm.ComponentModel; using Microsoft.VisualStudio.TestTools.UnitTesting; +#pragma warning disable MVVMTK0033 + namespace CommunityToolkit.Mvvm.UnitTests; [TestClass] diff --git a/tests/CommunityToolkit.Mvvm.UnitTests/Test_ObservablePropertyAttribute.cs b/tests/CommunityToolkit.Mvvm.UnitTests/Test_ObservablePropertyAttribute.cs index ac1cc9119..d105e4f64 100644 --- a/tests/CommunityToolkit.Mvvm.UnitTests/Test_ObservablePropertyAttribute.cs +++ b/tests/CommunityToolkit.Mvvm.UnitTests/Test_ObservablePropertyAttribute.cs @@ -8,7 +8,9 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Reflection; +#if NET6_0_OR_GREATER using System.Runtime.CompilerServices; +#endif using System.Text.Json.Serialization; using System.Threading.Tasks; using System.Xml.Serialization; @@ -19,6 +21,8 @@ using CommunityToolkit.Mvvm.Messaging.Messages; using Microsoft.VisualStudio.TestTools.UnitTesting; +#pragma warning disable MVVMTK0032, MVVMTK0033 + namespace CommunityToolkit.Mvvm.UnitTests; [TestClass] diff --git a/tests/CommunityToolkit.Mvvm.UnitTests/Test_ObservableRecipientAttribute.cs b/tests/CommunityToolkit.Mvvm.UnitTests/Test_ObservableRecipientAttribute.cs index 602fee322..9e2ee3dd7 100644 --- a/tests/CommunityToolkit.Mvvm.UnitTests/Test_ObservableRecipientAttribute.cs +++ b/tests/CommunityToolkit.Mvvm.UnitTests/Test_ObservableRecipientAttribute.cs @@ -12,6 +12,8 @@ using CommunityToolkit.Mvvm.Messaging; using Microsoft.VisualStudio.TestTools.UnitTesting; +#pragma warning disable MVVMTK0033 + namespace CommunityToolkit.Mvvm.UnitTests; [TestClass] diff --git a/tests/CommunityToolkit.Mvvm.UnitTests/Test_SourceGenerators.cs b/tests/CommunityToolkit.Mvvm.UnitTests/Test_SourceGenerators.cs index 815c43ee6..6ccde7030 100644 --- a/tests/CommunityToolkit.Mvvm.UnitTests/Test_SourceGenerators.cs +++ b/tests/CommunityToolkit.Mvvm.UnitTests/Test_SourceGenerators.cs @@ -7,6 +7,8 @@ using CommunityToolkit.Mvvm.Input; using Microsoft.VisualStudio.TestTools.UnitTesting; +#pragma warning disable MVVMTK0032 + namespace CommunityToolkit.Mvvm.UnitTests; ///